strimzi / metrics-reporter

Prometheus Metrics Reporter for Apache Kafka server and client compoenents
Apache License 2.0
4 stars 7 forks source link

Handle non-numeric metric values #21

Closed OwenCorrigan76 closed 2 months ago

OwenCorrigan76 commented 3 months ago

Prometheus only supports numeric values for metrics. A few metrics emitted by Kafka brokers and clients have non-numeric values. This PR will move the non-numeric value to a label and then and set its value to 1.0, to satisfy Prometheus only supporting numeric values.

Reported in the following issue: https://github.com/strimzi/metrics-reporter/issues/8

mimaison commented 3 months ago

Thanks for the PR. I seems to only handle non-numeric metrics in KafkaMetricsCollector. You also need to do it in YammerMetricsCollector.convert()

OwenCorrigan76 commented 2 months ago

@scholzj Is the PR description better? Thanks