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
Describe the bug KafkaMetrics converts the metric kafka.consumer.connection.count to a counter despite the number of connections not being monotonically increasing.
This is causing issues in in the opentelemetry micrometer shim, which relies counters being monotonically increasing for a proper translation to the opentelemetry data model.
To Reproduce
Run the KafkaClientMetricsIntegrationTest and observe that the printed meters should kafka.consumer.connection.count is a counter where it should probably be a gauge.
Expected behavior kafka.consumer.connection.count and other non-monotonically increasing kafka metrics should probably be gauges instead of counters.
Thank you for reporting the issue.
It looks like it would be correct for us to remove the OR conditional checking for names ending in count when deciding whether to make a counter or gauge since all the names ending in count appear to be an active count (gauge).
It looks like it would be correct for us to remove the OR conditional checking for names ending in count when deciding whether to make a counter or gauge
That does appear to be the case. I implemented something similar in opentelemetry recently and inspected the type of the KafkaMetric's org.apache.kafka.common.metrics.Measurable, and defined a mapping from measurable implementation to corresponding instrument type. This seemed safer to me than relying on naming naming conventions.
Describe the bug
KafkaMetrics converts the metric
kafka.consumer.connection.count
to a counter despite the number of connections not being monotonically increasing.This is causing issues in in the opentelemetry micrometer shim, which relies counters being monotonically increasing for a proper translation to the opentelemetry data model.
Environment
To Reproduce
Run the KafkaClientMetricsIntegrationTest and observe that the printed meters should
kafka.consumer.connection.count
is a counter where it should probably be a gauge.Expected behavior
kafka.consumer.connection.count
and other non-monotonically increasing kafka metrics should probably be gauges instead of counters.Originally discussed in CNCF slack here.
The text was updated successfully, but these errors were encountered: