Starknet Validator Monitoring (Pathfinder)

For full validator monitoring, it is necessary to collect metrics from both the Pathfinder node and the Attestation Service.

Pathfinder Metrics

To enable monitoring of Pathfinder endpoints, use the --monitor-address configuration option (or the MONITOR_ADDRESS environment variable).

For example, when running Pathfinder from source:

pathfinder --monitor-address 127.0.0.1:9101

Example prometheus.yml configuration:

scrape_configs:
  - job_name: 'pathfinder'
    relabel_configs:
      - source_labels: [__address__]
        regex: '(.+):(.+)'
        replacement: '${1}'
        target_label: 'host'
    static_configs:
      - targets: ['127.0.0.1:9101']

Validator Attestation Metrics

By default, the Validator Attestation Service exposes metrics at http://127.0.0.1:9090/metrics.

You can change this address using the --metrics-address option.

Example run:

starknet-validator-attestation --metrics-address 127.0.0.1:9102

Example prometheus.yml configuration:

scrape_configs:
  - job_name: 'starknet-attestation'
    relabel_configs:
      - source_labels: [__address__]
        regex: '(.+):(.+)'
        replacement: '${1}'
        target_label: 'host' 
    static_configs:
      - targets: ['127.0.0.1:9102']

This configuration snippet creates a common host label for both Pathfinder and Attestation instances, allowing you to combine their metrics on a single Grafana dashboard:

    relabel_configs:
      - source_labels: [__address__]
        regex: '(.+):(.+)'
        replacement: '${1}'
        target_label: 'host'

You can download a working version of the Grafana dashboard from our GitHub.