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 polygonMetrics Reference
| Metric | Type | Description |
|---|---|---|
chainwatch_sync_status | Gauge | 1=synced, 0=syncing |
chainwatch_current_block | Gauge | Current block number |
chainwatch_highest_block | Gauge | Highest known block |
chainwatch_peer_count | Gauge | Connected peers |
chainwatch_gas_price_gwei | Gauge | Gas price in gwei |
chainwatch_node | Info | Client 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 > 100CLI Reference
| Command | Description |
|---|---|
chainwatch exporter --chain ethereum --port 9100 | Start Prometheus exporter |
chainwatch exporter --interval 30 | Custom scrape interval |
chainwatch status --chain ethereum | One-shot health check |
chainwatch chains | List supported chains |