near / near-indexer-events

7 stars 1 forks source link

Feat: Support U64 Guage type for Prometheus metrics #30

Closed roshaans closed 1 year ago

roshaans commented 1 year ago

We are currently using an IntGauge metric type by rust-prometheus which supports i64 values to store the latest block height seen by the indexer. In its current state, this is fine, but as time goes by and this value gets larger and eventually goes out of bounds, it can cause a runtime exception or give us skewed metrics. We would like to avoid casting the u64 block height into a i64 value and instead use a guage metric type that supports u64 directly.

rust-prometheus currently does not support a Guage type for u64 values, so we have submitted an issue for that.

https://github.com/tikv/rust-prometheus/issues/470