A docker-compose is used to bundle prometheus and grafana services, the *overrides files define the ports and mounts the prometheus' configuration file.
If a new dashboard is designed, it can be mounted only in that *overrides file.
To run the node with metrics, the next steps should be followed:
- Build the
ethrexbinary with themetricsfeature enabled. - Enable metrics by using the
--metricsflag when starting the node. - Set the
--metrics.portcli arg of the ethrex binary to match the port defined inmetrics/provisioning/prometheus/prometheus*.yaml - Run the docker containers, example with the L2:
docker compose -f docker-compose-metrics.yaml -f docker-compose-metrics-l2.overrides.yaml upNote
The L2's Makefile automatically starts the prometheus and grafana services with make init for the L2.
- For the L2 we use the following files in conjunction:
docker-compose-metrics.yamldocker-compose-metrics-l2.overrides.yaml- The defaults are:
- PORT
3702→ metrics API (used by prometheus) - PORT
3802→ Grafana- usr:
admin - pwd:
admin
- usr:
- PORT
9092→ Prometheus
- PORT
An extra overrides file is available that enable alerts about the chain status. The alerts notify via Slack when the L2 is not advancing, the mempool is increasing fast (probably meaning that transactions are not getting processed), and if the chain is not advancing in L1.
To enable this feature, add the docker-compose-metrics-alerts.override.yaml file to the Docker Compose command. Also, the following environment variables must be set up:
GRAFANA_SLACK_CHANNEL: The name of the channel (or user ID) where the will be sent.GRAFANA_SLACK_TOKEN: A Slack token with write permissions on the desired channel's chat. This token starts withxoxb-.