Skip to content
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

Fix percentile metrics rotating too often #5237

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rafalh
Copy link

@rafalh rafalh commented Jul 1, 2024

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 #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
@pivotal-cla
Copy link

@rafalh Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@rafalh Thank you for signing the Contributor License Agreement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timer max expiry inconsistent with percentiles expiry
2 participants