-
Notifications
You must be signed in to change notification settings - Fork 993
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 max expiry inconsistent with percentiles expiry #3298
Comments
I just stepped onto this issue. |
Before this change percentile metrics rotation interval was set to `expiry / bufferLength`. This was different from other metrics like `_max` where the interval is set to `expiry`. At the same time documentation of the `expiry` parameter says clearly that it is used as rotation interval. This inconsistent behavior was confusing for users because some metrics expired faster than the others. What's more it caused some requests to be ignored in percentile metrics if `expiry` (also called `step`) was set to the same duration as scrapping interval (e.g. 1 minute) and scrapping occurred not long after buffer rotation. In case of the default config where `bufferLength` is 3 it could result in up to 33% requests being ignored by percentile metrics. Fix this inconsistency by changing buffer rotation interval for percentiles to `expiry`. Fixes micrometer-metrics#3298
Before this change percentile metrics rotation interval was set to `expiry / bufferLength`. This was different from other metrics like `_max` where the interval is set to `expiry`. At the same time documentation of the `expiry` parameter says clearly that it is used as rotation interval. This inconsistent behavior was confusing for users because some metrics expired faster than the others. What's more it caused some requests to be ignored in percentile metrics if `expiry` (also called `step`) was set to the same duration as scrapping interval (e.g. 1 minute) and scrapping occurred not long after buffer rotation. In case of the default config where `bufferLength` is 3 it could result in up to 33% requests being ignored by percentile metrics. Fix this inconsistency by changing buffer rotation interval for percentiles to `expiry`. Fixes micrometer-metrics#3298
Describe the bug
A single recorded time (sample) affects a
Timer
'smax()
for a longer time than percentiles produced by theTimer
. With defaultDistributionStatisticConfig
the effective expiry is one minute for the percentiles and three minutes for max. The issue is related to howTimeWindowMax
andAbstractTimeWindowHistogram
interpret the value ofDistributionStatisticConfig.expiry.
Both use ring buffers of same size to implement the decay, but while the former only moves by one buffer position in intervals equal toexpiry
, the latter is implemented to do a full rotation of the buffer in the same time.Environment
To Reproduce
Prints:
Expected behaviour
A single sample ceases to affect percentiles and timer max at the same point in time.
Related issues
In #2751 there is a complaint about max not expiring in expected time, but response was that the
TimeWindowMax
usesexpiry
(andbufferLength
) fromDistributionStatisticConfig
right.The text was updated successfully, but these errors were encountered: