ChainWatch

Prometheus metrics exporter for EVM blockchain nodes. Monitor sync status, peer count, gas prices, and client version. Grafana dashboard included.

Supported chains: Ethereum, Base, Polygon, Arbitrum

Quick Start

pip install chainwatch

# Start exporter
chainwatch exporter --chain ethereum --port 9100

# Metrics at http://localhost:9100/metrics

# One-shot health check
chainwatch status --chain polygon

Metrics Reference

MetricTypeDescription
chainwatch_sync_statusGauge1=synced, 0=syncing
chainwatch_current_blockGaugeCurrent block number
chainwatch_highest_blockGaugeHighest known block
chainwatch_peer_countGaugeConnected peers
chainwatch_gas_price_gweiGaugeGas price in gwei
chainwatch_nodeInfoClient version + chain

All metrics are labeled with chain for multi-chain filtering.

Grafana Dashboard

Import dashboards/node-health.json into Grafana. 7 panels with a $chain template variable:

  • 1. Sync Status (stat — green/red)
  • 2. Current Block (stat)
  • 3. Peer Count (gauge with thresholds)
  • 4. Gas Price (stat)
  • 5. Block Height Over Time (timeseries)
  • 6. Peer Count Over Time (timeseries)
  • 7. Gas Price Over Time (timeseries)
# prometheus.yml
scrape_configs:
  - job_name: chainwatch
    scrape_interval: 15s
    static_configs:
      - targets: ['localhost:9100']

Alert Rules

# Recommended Prometheus alerts
- alert: SyncLost
  expr: chainwatch_sync_status == 0
  for: 5m

- alert: LowPeers
  expr: chainwatch_peer_count < 3
  for: 2m

- alert: BlockStall
  expr: rate(chainwatch_current_block[5m]) == 0

- alert: GasSpike
  expr: chainwatch_gas_price_gwei > 100

CLI Reference

CommandDescription
chainwatch exporter --chain ethereum --port 9100Start Prometheus exporter
chainwatch exporter --interval 30Custom scrape interval
chainwatch status --chain ethereumOne-shot health check
chainwatch chainsList supported chains