-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timer did not reset after expire time. #2751
Comments
Firstly, you are using different versions of micrometer dependencies, which is likely to cause issues. Also, micrometer-spring-legacy is no longer supported. To answer your question, expiration of distribution statistics happens via a ring buffer. The expiration behavior is controlled by the ring buffer length and the time between rotation. The expiry duration set in your example controls the time between rotation. By default, the ring buffer has a length of 3. So it will take the buffer length * the rotation duration for a value to completely expire. Admittedly, this could be explained better in the reference documentation and is not intuitive from the method name. It is explained in the JavaDocs for related methods already, though. https://www.javadoc.io/doc/io.micrometer/micrometer-core/latest/io/micrometer/core/instrument/AbstractTimerBuilder.html
Looking forward, we could migrate the API to make the method names more intuitive. Perhaps something like |
Hi @shakuzen , can you please provide a compatibility table between micrometer and prometheus libs ? |
@shakuzen, from the method description it is not fully clear what is complete expire time. Is it possible to update the documentation with the info like: completely expire time = buffer length (distributionStatisticBufferLength) * the rotation duration (distributionStatisticExpiry)? |
Is this still a problem with the latest versions? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open. |
Hi, I have implemented a very simple configuration to use Prometheus Timer :
Config:
Start-Stop Timer code with 1 hour expire time:
However, during 1 hour I did not make any requests, but the current max time was still there:
It expired after 2+ hours.
Dependencies:
io.micrometer:micrometer-spring-legacy:1.3.20
io.micrometer:micrometer-registry-prometheus:1.7.2
Could you please answer what is wrong? Maybe my understanding of Timer expiry time is incorrect.
The text was updated successfully, but these errors were encountered: