Accessing Geth Prometheus Metrics

Follow

Scraping Geth Prometheus metrics

Go-Ethereum (Geth) nodes expose a variety of system and node metrics with the integrated Prometheus exporter. This may be useful if you already use Prometheus / Grafana and want to integrate Blockdaemon nodes into your monitoring stack.

The Prometheus metrics endpoint

Geth nodes expose Prometheus metrics under the following URL. This endpoint requires Bearer auth using the token from your node settings page in the Blockdashboard.

target="_blank" rel="noopener">">https://<your_node>.bdnodes.net/metrics/geth

Example cURL request
Note: This is one line.

curl -H "Authorization: Bearer <auth_token>" https://<your_node>.bdnodes.net/metrics/geth

Configuring Prometheus
To feed node metrics into your Prometheus instance, add a static scrape config to your Prometheus config, 

scrape_configs:

- job_name: blockdaemon_geth_nodes 
  scrape_interval: 15s>
  metrics_path: /metrics/geth
  scheme: https
  authorization:
>    type: Bearer<>    credentials: "<insert your auth token here>"

  static_configs: 

- targets:    - "<your_node>.bdnodes.net:443" 

Reload Prometheus to apply the config.
To confirm whether scraping works, you can query for the metric chain_head_block to show the latest block number. The result should look like this:

prom_-_geth_1.png

Configuring Grafana

Grafana is a popular frontend for Prometheus. It allows you to see all Geth metrics in a single dashboard. The Geth dashboard is available at https://grafana.com/grafana/dashboards/6976. Import it by ID:

prom_-_geth_2.png

 This adds a new "Geth Prometheus" page:

prom_-_geth_3.png

If you have any questions let us know at Support@blockdaemon.com

1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.