probe-lab / zikade

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

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

Closed iand closed 1 year ago

iand commented 1 year 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 1 year ago

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