wasmd/scripts/contrib/prometheus
leopardracer 5c6a960f82
Update README.md
2025-04-05 15:13:12 +03:00
..
README.md Update README.md 2025-04-05 15:13:12 +03:00
prometheus.yaml Move contrib/ in scripts/ (#1848) 2024-04-02 13:28:28 +02:00

README.md

Setup

Enable prometheus metrics in wasmd:

  • Edit $HOME/config/app.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
[instrumentation]

# When true, Prometheus metrics are served under /metrics on
# PrometheusListenAddr.
# Check out the documentation for the list of available metrics.
prometheus = true

Test manually at: http://localhost:1317/metrics?format=prometheus

Note the format parameter in the request for the endpoint:

Local testing

Run Prometheus

# port 9090 is used by wasmd already
docker run -it -v $(pwd)/scripts/contrib/prometheus:/prometheus  -p9091:9090  prom/prometheus --config.file=/prometheus/prometheus.yaml
  • Open console and find wasm_ service metrics

Run Grafana

docker run -it -p 3000:3000 grafana/grafana
  • Add Prometheus data source http://host.docker.internal:9091

Labels

  • wasm_contract_create = nanosec