Let's go through a quick way to setup metrics using a local grafana/otel-lgtm
backend. This particular dashboard is for testing purposes, and I hope it helps inspire better community submissions. If you have suggestions for metrics, please share in the discord!
We're going to be following the tutorial from this grafana blog post
If you're not already running a node then skip to step 2. If you are, this is a good time to stop your node.
In your terminal, run:
docker run -p 3000:3000 -p 4317:4317 -p 4318:4318 --rm -ti grafana/otel-lgtm
At this point you can navigate your browser to https:localhost:3000 and you'll see an empty Grafana screen.
Tap import dashboard from the top right of your screen and paste the following ID: 23054 and hit load. Once you've imported the Aztec Validator dashboard, time to direct OpenTelemetry signals to the data sources.
Depending on your setup, use the following env variables:
export OTEL_COLLECTOR_ENDPOINT="http://host.docker.internal:4318"
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/logs
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/metrics
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_COLLECTOR_ENDPOINT/v1/traces
and start your node!
It takes a few minutes but you should start to see your node's metrics visualized.