Closed VladimirZaitsev21 closed 2 weeks ago
Thank you for the issue! Do you think you can provide us a minimal Java sample to reproduce this issue so we can more easily investigate and ensure any fix is working properly for your use case? (Right now the reproducer does not seems simple nor Java.)
I think this is a duplicate of https://github.com/micrometer-metrics/micrometer/issues/5193 so let me close this and continue the discussion there, please let us know if you disagree and we can reopen.
Describe the bug We use![image](https://github.com/micrometer-metrics/micrometer/assets/85500340/e0da821c-c5a9-44db-b83d-32cf88e1f7c7)
io.micrometer.core.instrument.Timer
and build a histogram based on it. Sometimes anIllegalArgumentException
with message"Counts in ClassicHistogramBuckets cannot be negative."
occurs. We have redefined thePrometheusMeterRegistry
with ourLoggingPrometheusMeterRegistry
to get additional information about the data on which this exception occurs. Image below shows the problem.We logged a Histogram Snapshot and got the following:
If you try to create a Timer using such a snapshot, the described exception will be thrown.
Environment
To Reproduce LoggingPrometheusMeterRegistry class to reproduce the bug is shown below:
Also, here is the main method to reproduce the bug.
Expected behavior It seems like Histogram should be created in normal way in this case.
Additional context It is likely that the changes taking place in the
PrometheusMeterRegistry.addDistributionStatisticSamples
during the transition from version 1.12.6 to version 1.13.0 could affect the operation of this scenario