Skip to content

Metrics

Monitoring your blockchain node is essential for maintaining performance, detecting issues, and ensuring uptime.


┌─────────────────────────────────────────────────────────────────┐
│ MONITORING OBJECTIVES │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. PERFORMANCE │
│ - Track sync progress │
│ - Monitor resource usage │
│ │
│ 2. AVAILABILITY │
│ - Detect node downtime │
│ - Alert on failures │
│ │
│ 3. SECURITY │
│ - Detect unusual patterns │
│ - Monitor access attempts │
│ │
│ 4. CAPACITY PLANNING │
│ - Track storage growth │
│ - Plan upgrades │
│ │
└─────────────────────────────────────────────────────────────────┘

Terminal window
# Enable metrics
geth --metrics --metrics.addr 0.0.0.0 --metrics.port 6060
http://localhost:6060/debug/metrics
http://localhost:6060/debug/metrics/prometheus

MetricDescription
eth_block_numberCurrent block height
eth_head_headerLatest header number
eth_syncingSync progress
MetricDescription
process_cpu_secondsCPU usage
process_memoryMemory usage
node_disk_ioDisk I/O
MetricDescription
p2p_peersNumber of connected peers
p2p_dial_connectionsOutgoing connections
p2p_recv_messagesMessages received

Terminal window
# Download
wget https://github.com/prometheus/prometheus/releases/download/v2.45.0/prometheus-2.45.0.linux-amd64.tar.gz
# Extract
tar xzf prometheus-2.45.0.linux-amd64.tar.gz
# Run
./prometheus --config.file=prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'geth'
static_configs:
- targets: ['localhost:6060']

  1. Install Grafana
  2. Add Prometheus data source
  3. Import dashboard:
    • Ethereum: Dashboard ID 14611
    • Generic: Create custom
DashboardDescription
Block ProductionBlock times, empty blocks
Node HealthCPU, memory, disk
NetworkPeers, transaction pool
ConsensusValidator performance

groups:
- name: geth-alerts
rules:
- alert: NodeDown
expr: up{job="geth"} == 0
for: 5m
labels:
severity: critical
annotations:
summary: "Geth node is down"
- alert: NoPeers
expr: p2p_peers == 0
for: 5m
labels:
severity: warning
- alert: SyncStalled
expr: eth_syncing == true
for: 30m
labels:
severity: warning

  • Enable metrics with --metrics flag
  • Track sync, performance, and network metrics
  • Use Prometheus + Grafana for monitoring
  • Set up alerts for critical issues

In Chapter 37: Logging & Log Management, we’ll explore logging.


Last Updated: 2026-02-20