strimzi / metrics-reporter

Prometheus Metrics Reporter for Apache Kafka server and client components
Apache License 2.0
5 stars 10 forks source link

Use PrometheusNaming.prometheusName before matching metrics with the allowlist #30

Closed mimaison closed 3 months ago

mimaison commented 4 months ago

Current we use PrometheusNaming.sanitizeMetricName() before matching the metric names. It turns out the group of Yammer metrics is using the kafka.<component> format, and sanitizeMetricName() allows ..

However once serialized in the prometheus text format (which is what we expect for the allowlist), . are replaced by _. So for example today you need to use kafka_server_kafka.network_requestmetrics_totaltimems in your allowlist to match that metric. Instead we should have kafka_server_kafka_network_requestmetrics_totaltimems.

mimaison commented 4 months ago

This seems caused by an issue in the Prometheus library. I opened https://github.com/prometheus/client_java/issues/974