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
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.
Statistics emanating from a timer like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets). Samples are accumulated to such statistics in ring buffers which rotate after this expiry, with a buffer length of distributionStatisticBufferLength(Integer).
Looking forward, we could migrate the API to make the method names more intuitive. Perhaps something like expiryRotationTime? Suggestions welcome.
@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)?
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.
Activity
shakuzen commentedon Aug 19, 2021
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
expiryRotationTime? Suggestions welcome.LatsykNS commentedon Dec 1, 2021
Hi @shakuzen , can you please provide a compatibility table between micrometer and prometheus libs ?
LatsykNS commentedon Dec 1, 2021
@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)?
marcingrzejszczak commentedon Dec 20, 2023
Is this still a problem with the latest versions?
github-actions commentedon Jan 2, 2024
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.
github-actions commentedon Jan 10, 2024
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.
Clarify complete expiry of distribution statistics in Javadoc
Clarify complete expiry of distribution statistics in Javadoc (#4581)