forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cosmos#463 from CosmWasm/telemetry_387
Add telemetry
- Loading branch information
Showing
6 changed files
with
85 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Setup | ||
Enable prometheus metrics in wasmd: | ||
|
||
* Edit `$HOME/config/app.toml` | ||
```toml | ||
[telemetry] | ||
|
||
# Enabled enables the application telemetry functionality. When enabled, | ||
# an in-memory sink is also enabled by default. Operators may also enabled | ||
# other sinks such as Prometheus. | ||
enabled =true | ||
# ... | ||
|
||
# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. | ||
prometheus-retention-time = 15 | ||
``` | ||
|
||
`retention-time` must be >0 (see prometheus scrape config) | ||
|
||
|
||
|
||
* Edit `$HOME/config/config.toml` | ||
```toml | ||
[instrumentation] | ||
|
||
# When true, Prometheus metrics are served under /metrics on | ||
# PrometheusListenAddr. | ||
# Check out the documentation for the list of available metrics. | ||
prometheus = true | ||
``` | ||
# Local testing | ||
## Run Prometheus | ||
```sh | ||
# port 9090 is used by wasmd already | ||
docker run -it -v $(pwd)/contrib/prometheus:/prometheus -p9091:9090 prom/prometheus --config.file=/prometheus/prometheus.yaml | ||
``` | ||
* Open [console](http://localhost:9091) and find `wasm_`service metrics | ||
|
||
## Run Grafana | ||
|
||
```shell | ||
docker run -it -p 3000:3000 grafana/grafana | ||
``` | ||
* Add Prometheus data source | ||
`http://host.docker.internal:9091` | ||
### Labels | ||
* `wasm_contract_create` = nanosec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
global: | ||
scrape_interval: 15s # By default, scrape targets every 15 seconds. | ||
evaluation_interval: 15s # By default, scrape targets every 15 seconds. | ||
rule_files: | ||
|
||
scrape_configs: | ||
- job_name: wasmd | ||
|
||
scrape_interval: 5s | ||
static_configs: | ||
- targets: ['host.docker.internal:26660'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters