Fix/configurable min step duration#4536
Open
manab-pr wants to merge 3 commits intografana:mainfrom
Open
Conversation
Contributor
2ae2a29 to
f2ac98a
Compare
Author
|
@simonswine Sorry about that! I accidentally included changes from #4526 when I started |
Author
|
@simonswine The branch has been rebased and is ready for another look. Could you please review when you get a chance? Thanks. |
This change addresses issue grafana#4524 where users setting `collect_interval` below 15 seconds (e.g., 5s for eBPF profiling) were seeing their data displayed at 15-second intervals in the UI due to a hardcoded minimum step duration. Changes: - Added `--querier.min-step-duration` flag (default: 15s) to allow users to configure the minimum step duration for timeline calculations - Created `CalcPointIntervalWithMinInterval` function that accepts a custom minimum interval parameter - Updated HTTP handlers to pass the configurable value through the call chain - Added comprehensive tests covering eBPF use cases (1s, 5s intervals) - Maintains backward compatibility with 15-second default Users can now run Pyroscope with `--querier.min-step-duration=5s` to support fast eBPF profiling collection intervals while maintaining fine-grained resolution in the UI. Fixes grafana#4524
c445b85 to
bef2c05
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit bb21493. Configure here.
Author
|
@simonswine please review it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Note
Medium Risk
Changes the timeline step calculation used by
SelectSeriesand exposes it via a new--querier.min-step-durationflag, which can alter query resolution and backend load. Risk is moderate because it affects query behavior across all read paths, though defaults preserve existing behavior.Overview
Makes the UI timeline/series query step configurable instead of being hard-clamped to 15s by introducing
querier.min-step-duration(default 15s) and plumbing it through API registration into the HTTP render handlers.Adds
timeline.CalcPointIntervalWithMinInterval(with guards for sub-second values and rounding not violating the minimum) and switchesSelectSeriesrequests to use it; updates and expands tests to cover custom minimums (e.g., 1s/5s) and edge cases.Reviewed by Cursor Bugbot for commit 9c6d257. Bugbot is set up for automated code reviews on this repo. Configure here.