Files
lighthouse/book/src/api_metrics.md
chonghe 3f6c11db0e Some updates to Lighthouse book (#6995)
* #6447


  - Move some deprecated pages to a new section under `Archived`

- Remove fallback log in mev as the log will not be present after VC using `/eth/v3/validator/blocks` endpoint by default
- Add warning against using Btrfs file system (thank you @ChosunOne for the report)
- Add data shared by @mcdee  on tree states API queries time
- Rename partial withdrawals to validator sweep to differentiate it from the upcoming execution layer partial withdrawals
- Update NAT API response
- Update docs on IPv6

- Rename .md files to follow a standard prefix section name, e.g., installation_*.md, advanced_*.md
- Standardise .md files using underscore `_` instead of hyphen `-` to be consistent with other files naming conventions.
2025-03-24 02:30:20 +00:00

2.7 KiB

Prometheus Metrics

Lighthouse provides an extensive suite of metrics and monitoring in the Prometheus export format via a HTTP server built into Lighthouse.

These metrics are generally consumed by a Prometheus server and displayed via a Grafana dashboard. These components are available in a docker-compose format at sigp/lighthouse-metrics.

Beacon Node Metrics

By default, these metrics are disabled but can be enabled with the --metrics flag. Use the --metrics-address, --metrics-port and --metrics-allow-origin flags to customize the metrics server.

Example

Start a beacon node with the metrics server enabled:

lighthouse bn --metrics

Check to ensure that the metrics are available on the default port:

curl localhost:5054/metrics

Validator Client Metrics

By default, these metrics are disabled but can be enabled with the --metrics flag. Use the --metrics-address, --metrics-port and --metrics-allow-origin flags to customize the metrics server.

Example

Start a validator client with the metrics server enabled:

lighthouse vc --metrics

Check to ensure that the metrics are available on the default port:

curl localhost:5064/metrics

Remote Monitoring

Lighthouse has the ability to send a subset of metrics to a remote server for collection. Presently the main server offering remote monitoring is beaconcha.in. Instructions for setting this up can be found in beaconcha.in's docs:

The Lighthouse flag for setting the monitoring URL is --monitoring-endpoint.

When sending metrics to a remote server you should be conscious of security:

  • Only use a monitoring service that you trust: you are sending detailed information about your validators and beacon node to this service which could be used to track you.
  • Always use an HTTPS URL to prevent the traffic being intercepted in transit.

The specification for the monitoring endpoint can be found here:

Note: the similarly named Validator Monitor feature is entirely independent of remote metric monitoring.

Update Period

You can adjust the frequency at which Lighthouse sends metrics to the remote server using the --monitoring-endpoint-period flag. It takes an integer value in seconds, defaulting to 60 seconds.

lighthouse bn --monitoring-endpoint-period 60 --monitoring-endpoint "https://url"

Increasing the monitoring period between can be useful if you are running into rate limits when posting large amounts of data for multiple nodes.