Monitoring Juno 📊
Juno uses Prometheus to monitor and collect metrics data, which you can visualise with Grafana. You can use these insights to understand what is happening when Juno is running.
Enable the metrics server​
To enable the metrics server, use the following configuration options:
metrics
: Enables the Prometheus metrics endpoint on the default port (disabled by default).metrics-host
: The interface on which the Prometheus endpoint will listen for requests. If skipped, it defaults tolocalhost
.metrics-port
: The port on which the Prometheus endpoint will listen for requests. If skipped, it defaults to9090
.
# Docker container
docker run -d \
--name juno \
-p 9090:9090 \
nethermind/juno \
--metrics \
--metrics-port 9090 \
--metrics-host 0.0.0.0 \
--eth-node <YOUR-ETH-NODE>
# Standalone binary
./build/juno --metrics --metrics-port 9090 --metrics-host=0.0.0.0 --eth-node <YOUR-ETH-NODE>
Configure Grafana dashboard​
The Juno Grafana dashboard is optimized for single-node deployments and uses generic metric selectors that work with standard Prometheus configurations.
1. Set up Grafana​
- Follow the Set up Grafana guide to install Grafana.
- Download and configure the Grafana dashboard file.
2. Set up Prometheus​
- Follow the First steps with Prometheus guide to install Prometheus.
- Add the Juno metrics endpoint in the
prometheus.yml
configuration file:
scrape_configs:
- job_name: "juno"
static_configs:
- targets: ["localhost:9090"]
3. Set up Grafana Loki​
- Follow the Get started with Grafana Loki guide to install Loki.
- Configure Loki to collect logs from Juno. You might need to configure log paths or use Promtail (Loki's agent) to send logs to Loki:
scrape_configs:
- job_name: "juno-logs"
labels:
job: "juno"
__path__: "/path/to/juno/logs/*"
To have Juno write logs to a file, use the command:
./build/juno >> /path/juno.log 2>&1
4. Configure the data sources​
- Follow the Grafana data sources guide to add data sources.
- Choose Prometheus as a data source:
- Enter the URL where Prometheus is running, e.g.,
http://localhost:9090
. - Click the "Save & Test" button.
- Choose Loki as a data source:
- Enter the URL where Loki is running, e.g.,
http://localhost:3100
. - Click the "Save & Test" button.
Health endpoints for Kubernetes​
Juno provides standard health endpoints that are designed to work with Kubernetes liveness and readiness probes:
/live
endpoint​
The /live
endpoint always returns a 200 OK
response to indicate that the Juno process is running. This endpoint is intended for use with Kubernetes livenessProbe
to prevent unnecessary container restarts.
livenessProbe:
httpGet:
path: /live
port: 6060
initialDelaySeconds: 30
periodSeconds: 10