This package provisions eight Grafana-managed alert rules:
- Host CPU > 80% for 5 minutes
- Besu process CPU > 0.8 CPU cores for 5 minutes
- Filesystem usage > 80% for 5 minutes
- CPU I/O wait > 10% for 5 minutes
- Host memory usage > 85% for 5 minutes
- Besu JVM heap usage > 85% of max heap for 5 minutes
- Combined server network traffic > 100 MiB/s for 5 minutes
- Established TCP connections > 1000 for 5 minutes
Open both YAML files and replace:
PROMETHEUS_DS_UIDwith the UID of the Prometheus data source in Grafana.ALERT_EMAIL_TOwith one or more recipients. Separate multiple addresses with semicolons.
The Prometheus UID is shown in Grafana at Connections -> Data sources -> Prometheus. It is also present in the data-source URL.
The rules assume these Prometheus job labels:
- node exporter:
jobmatchesnode-exporter.* - Besu:
jobmatchesbesu.*
Change those two regular expressions when your prometheus.yml uses different job names.
For a package installation, edit /etc/grafana/grafana.ini:
[smtp]
enabled = true
host = smtp.example.com:587
user = monitoring@example.com
password = CHANGE_ME
from_address = monitoring@example.com
from_name = Grafana Besu Alerts
skip_verify = false
startTLS_policy = MandatoryStartTLSFor Docker or Docker Compose, copy the values from grafana-smtp.env.example into the Grafana container environment.
sudo cp 01-alert-rules.yml /etc/grafana/provisioning/alerting/
sudo cp 02-email-contact-point.yml /etc/grafana/provisioning/alerting/
sudo systemctl restart grafana-serverMount the directory into Grafana:
services:
grafana:
image: grafana/grafana:latest
volumes:
- ./grafana-besu-alerts:/etc/grafana/provisioning/alerting:ro
environment:
GF_SMTP_ENABLED: "true"
GF_SMTP_HOST: "smtp.example.com:587"
GF_SMTP_USER: "monitoring@example.com"
GF_SMTP_PASSWORD: "CHANGE_ME"
GF_SMTP_FROM_ADDRESS: "monitoring@example.com"
GF_SMTP_FROM_NAME: "Grafana Besu Alerts"
GF_SMTP_STARTTLS_POLICY: "MandatoryStartTLS"Then run:
docker compose up -d --force-recreate grafanaGrafana can also reload files without a full restart:
curl -X POST -u admin:YOUR_PASSWORD \
http://localhost:3000/api/admin/provisioning/alerting/reloadIn Grafana:
- Open Alerting -> Alert rules and confirm the folder
Besu Infrastructure Alertsexists. - Open Alerting -> Contact points -> besu-email and send a test notification.
- Open Prometheus Explore and run each PromQL expression. A missing series usually means the
joblabel or metric name differs. - Temporarily lower one threshold, wait for the
for: 5mperiod, and confirm both firing and resolved emails.
- File-provisioned resources are read-only in the Grafana UI. Edit the YAML and reload or restart Grafana.
02-email-contact-point.ymlprovisions the complete notification-policy tree and routes the root policy tobesu-email. It can overwrite existing policies. If you already have policies, merge thebesu-emailroute into your existing exported policy file instead of copying this file directly.- The Besu CPU expression returns CPU cores used.
0.8means 80% of one core. A busy multi-threaded Besu process can exceed1.0. Tune this threshold after observing the normal baseline. - Besu JVM metric names changed in newer releases. The heap rule supports both the older
jvm_memory_bytes_*and newerjvm_memory_*_bytesnames. - Network and connection thresholds are starting values. Set them from your normal baseline and link capacity.