probe-lab / zikade

A Go implementation of the libp2p Kademlia DHT specification
Other
8 stars 3 forks source link

fix: remove metric units that are interpreted as ratios #49

Closed iand closed 9 months ago

iand commented 9 months ago

Metrics with a unit of "1" are interpreted as ratios by the prometheus exporter, which has the side effect of appending _ratio to the metric name. This is supposed to only be done for gauges but is actually applied to counters too. See https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/translator/prometheus for the transformations applied by the prometheus exporter. Since we were using "1" for dimensionless counts I have simply removed the units.

This PR also hooks up the SentMessages, SentMessageErrors, SentRequests, SentRequestErrors, OutboundRequestLatency and SentBytes DHT metrics.

iand commented 9 months ago

Failed test is https://github.com/plprobelab/zikade/issues/48