2021-06-10 00:49:02 +00:00
|
|
|
Add flag `--metrics` to Erigon or any other process (add `--metrics.addr` if need).
|
|
|
|
|
|
|
|
Add hosts to collecting metrics in: `./cmd/prometheus/prometheus.yml`
|
|
|
|
|
2021-06-10 00:50:20 +00:00
|
|
|
Run Grafana and Prometheus: `docker-compose up -d prometheus grafana` or `make prometheus`
|
2020-04-11 07:22:23 +00:00
|
|
|
|
2020-10-21 04:24:22 +00:00
|
|
|
Go to: [localhost:3000](localhost:3000), admin/admin
|
|
|
|
|
2020-10-21 04:22:25 +00:00
|
|
|
Env variables:
|
2020-10-24 03:15:53 +00:00
|
|
|
|
|
|
|
- `XDG_DATA_HOME` re-defines default prometheus and grafana databases folder.
|
2021-05-26 10:35:39 +00:00
|
|
|
- `ERIGON_PROMETHEUS_CONFIG` path to custom `prometheus.yml` file. Default is: `./cmd/prometheus/prometheus.yml`
|
|
|
|
- `ERIGON_GRAFANA_CONFIG` path to custom `grafana.ini file`. Default is: `./cmd/prometheus/grafana.ini`
|
2020-10-21 04:22:25 +00:00
|
|
|
|
2021-05-26 10:35:39 +00:00
|
|
|
To add custom Erigon host: copy `./cmd/prometheus/prometheus.yml`, modify, pass new location by:
|
|
|
|
`ERIGON_PROMETHEUS_CONFIG=/new/location/prometheus.yml docker-compose up prometheus grafana`
|
2020-04-18 20:09:44 +00:00
|
|
|
|
2020-10-24 03:15:53 +00:00
|
|
|
## For developers
|
|
|
|
|
|
|
|
#### How to update dashboards
|
|
|
|
|
|
|
|
1. Edit dashboard right in Grafana UI as you need. Save.
|
|
|
|
2. Go to "Dashboard Settings" -> "JSON Model" -> Copy json representation of dashboard.
|
2021-05-26 10:35:39 +00:00
|
|
|
3. Go to file `./cmd/prometheus/dashboards/erigon.json` and past json there.
|
2020-10-24 03:15:53 +00:00
|
|
|
4. Commit and push. Done.
|
|
|
|
|
|
|
|
#### How to add new metrics
|
|
|
|
|
|
|
|
See example: `ethdb/object_db.go:dbGetTimer`
|
2020-04-11 07:22:23 +00:00
|
|
|
|
2020-10-24 03:15:53 +00:00
|
|
|
For gRPC metrics search in code: `grpc_prometheus.Register`
|