good morning!!!!

Skip to content
Snippets Groups Projects
Readme.md 1.21 KiB
Newer Older
Alex Sharov's avatar
Alex Sharov committed
Add flag `--metrics` to Erigon or any other process (add `--metrics.addr` if need).

Add hosts to collecting metrics in: `./cmd/prometheus/prometheus.yml`

Alex Sharov's avatar
Alex Sharov committed
Run Grafana and Prometheus: `docker-compose up -d prometheus grafana` or `make prometheus`
alex.sharov's avatar
alex.sharov committed
Go to: [localhost:3000](localhost:3000), admin/admin

alex.sharov's avatar
alex.sharov committed
Env variables:

- `XDG_DATA_HOME` re-defines default prometheus and grafana databases folder.
- `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`
alex.sharov's avatar
alex.sharov committed

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`
## 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.
3. Go to file `./cmd/prometheus/dashboards/erigon.json` and past json there.
4. Commit and push. Done. 

#### How to add new metrics

See example: `ethdb/object_db.go:dbGetTimer`
For gRPC metrics search in code: `grpc_prometheus.Register`