You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: remove metric units that are interpreted as ratios (#49)
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.
t.ReceivedMessages, err=meter.Int64Counter("received_messages", metric.WithDescription("Total number of messages received per RPC"), metric.WithUnit("1"))
66
+
t.ReceivedMessages, err=meter.Int64Counter("received_messages", metric.WithDescription("Total number of messages received per RPC"))
t.ReceivedMessageErrors, err=meter.Int64Counter("received_message_errors", metric.WithDescription("Total number of errors for messages received per RPC"), metric.WithUnit("1"))
71
+
t.ReceivedMessageErrors, err=meter.Int64Counter("received_message_errors", metric.WithDescription("Total number of errors for messages received per RPC"))
t.SentMessageErrors, err=meter.Int64Counter("sent_message_errors", metric.WithDescription("Total number of errors for messages sent per RPC"), metric.WithUnit("1"))
96
+
t.SentMessageErrors, err=meter.Int64Counter("sent_message_errors", metric.WithDescription("Total number of errors for messages sent per RPC"))
t.SentRequestErrors, err=meter.Int64Counter("sent_request_errors", metric.WithDescription("Total number of errors for requests sent per RPC"), metric.WithUnit("1"))
106
+
t.SentRequestErrors, err=meter.Int64Counter("sent_request_errors", metric.WithDescription("Total number of errors for requests sent per RPC"))
0 commit comments