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
I’ve found an issue for histograms where the numbers in the buckets are not getting populated properly - the wrong numbers are showing up. This happens for the zio micrometer integration which is then hooked up to Prometheus. This is not an issue for the direct Prometheus connector.
# HELP histogramMetricReproducer
# TYPE histogramMetricReproducer histogram
histogramMetricReproducer_bucket{le="0.1"} 0 --> the value 0.04 is <= 0.1 but not showing up here
histogramMetricReproducer_bucket{le="1.0"} 3
histogramMetricReproducer_bucket{le="5.0"} 3
histogramMetricReproducer_bucket{le="10.0"} 4
histogramMetricReproducer_bucket{le="+Inf"} 4
histogramMetricReproducer_count 4
histogramMetricReproducer_sum 7.04
# HELP histogramMetricReproducer_max
# TYPE histogramMetricReproducer_max gauge
histogramMetricReproducer_max 6.0
which is super odd, it did not record 0.04 in the <0.1 bucket :S
Running this directly against the prometheus connector with the same code produces the correct results:
If you increase it past 1, then it captures correctly via micrometer:
# HELP histogramMetricReproducer
# TYPE histogramMetricReproducer histogram
histogramMetricReproducer_bucket{le="1.0"} 1
histogramMetricReproducer_bucket{le="10.0"} 2
histogramMetricReproducer_bucket{le="20.0"} 3
histogramMetricReproducer_bucket{le="100.0"} 4
histogramMetricReproducer_bucket{le="+Inf"} 4
histogramMetricReproducer_count 4
histogramMetricReproducer_sum 114.0
# HELP histogramMetricReproducer_max
# TYPE histogramMetricReproducer_max gauge
histogramMetricReproducer_max 90.0
This is problematic because zio-http and tapir integrations use seconds as their histogram boundaries for ZIO Metrics histograms which result in small numbers and will cause metric latencies not to appear properly if you use the micrometer integration.
I tried to dig deeper to see what the cause is and I believe the problem resides with Micrometer
I’ve found an issue for histograms where the numbers in the buckets are not getting populated properly - the wrong numbers are showing up. This happens for the zio micrometer integration which is then hooked up to Prometheus. This is not an issue for the direct Prometheus connector.
If you run this in SampleMicrometerApp and look at the metrics on http://localhost:8080/micrometer/prometheusMetrics
You end up with
which is super odd, it did not record 0.04 in the <0.1 bucket :S
Running this directly against the prometheus connector with the same code produces the correct results:
i found something very interesting:
If you increase it past 1, then it captures correctly via micrometer:
This is problematic because zio-http and tapir integrations use seconds as their histogram boundaries for ZIO Metrics histograms which result in small numbers and will cause metric latencies not to appear properly if you use the micrometer integration.
I tried to dig deeper to see what the cause is and I believe the problem resides with Micrometer
I also added some debug statements here to print what is being fed into
updateHistogram
and it appears the correct values are being fed inzio-metrics-connectors/micrometer/src/main/scala/zio/metrics/connectors/micrometer/MicrometerMetricListener.scala
Line 40 in 5396527
The text was updated successfully, but these errors were encountered: