lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Replace prometheus client with the official one

Open ackintosh opened this issue 3 years ago • 5 comments

Description

Prometheus team have released an official Prometheus instrumentation library for Rust.

https://github.com/prometheus/client_rust

  • announcement: https://twitter.com/PrometheusIO/status/1483584441419276293
  • background: https://github.com/tikv/rust-prometheus/issues/392#issuecomment-968072946

We're not having any problems with the current client for now, however, I believe we would take benefits from the official one. ref: https://github.com/tikv/rust-prometheus/issues/392

ackintosh avatar Jan 25 '22 08:01 ackintosh

In lighthouse, the client is used to:

  1. provide metrics endpoint for Prometheus HTTP server, in OpenMetrics specification.
  • beacon_node/http_metrics crate
  • validator_client/http_metrics crate
  1. send BeaconNode/Validator metrics to custom endpoint (e.g. beaconcha.in), in "JSON".
  • monitoring_api crate

The metrics is defined as Ethereum consensus client metrics and Beacon chain metrics.

ackintosh avatar Feb 08 '22 01:02 ackintosh

:wave: libp2p and prometheus-client maintainer here.

Another benefit would be dependency consolidation. libp2p uses prometheus-client and in turn the lighthouse network stack uses prometheus-client.

mxinden avatar Feb 15 '22 10:02 mxinden

📝 I'm working on https://github.com/prometheus/client_rust/pull/47. This makes the client able to do our the 2. use case I've mentioned here.

ackintosh avatar Mar 20 '22 14:03 ackintosh

📝 I found out that lighthouse is using HistogramTimer, which is timer to measure and record the duration of an event. (e.g. here)

For now, if I understand correctly, the official client doesn’t have a functionality equivalent to HistogramTimer.

ackintosh avatar Apr 01 '22 23:04 ackintosh

I find HistogramTimer a need feature of the prometheus crate. I think it is worth proposing it to the prometheus-client crate @ackintosh.

mxinden avatar Apr 05 '22 19:04 mxinden