Skip to content

Fix/configurable min step duration#4536

Open
manab-pr wants to merge 3 commits intografana:mainfrom
manab-pr:fix/configurable-min-step-duration
Open

Fix/configurable min step duration#4536
manab-pr wants to merge 3 commits intografana:mainfrom
manab-pr:fix/configurable-min-step-duration

Conversation

@manab-pr
Copy link
Copy Markdown

@manab-pr manab-pr commented Oct 17, 2025

     Fixes #4524
    fix: make minimum step duration configurable for eBPF profiling

     This change addresses issue #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.

Note

Medium Risk
Changes the timeline step calculation used by SelectSeries and exposes it via a new --querier.min-step-duration flag, 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 switches SelectSeries requests 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.

@manab-pr manab-pr requested review from a team and marcsanmi as code owners October 17, 2025 15:00
@simonswine
Copy link
Copy Markdown
Contributor

@manab-pr do you mind rebasing this? This seems to contain also the changeset from #4526 .

@manab-pr manab-pr force-pushed the fix/configurable-min-step-duration branch from 2ae2a29 to f2ac98a Compare October 20, 2025 12:17
@manab-pr
Copy link
Copy Markdown
Author

@simonswine Sorry about that! I accidentally included changes from #4526 when I started
working on this issue. I've now rebased the branch and it should be clean - only
contains the eBPF profiling changes for #4524. Could you please take another look
when you get a chance?

@manab-pr
Copy link
Copy Markdown
Author

@simonswine The branch has been rebased and is ready for another look. Could you please review when you get a chance? Thanks.

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 3, 2026

CLA assistant check
All committers have signed the CLA.

Comment thread pkg/pyroscope/modules_experimental.go Outdated
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
@manab-pr manab-pr force-pushed the fix/configurable-min-step-duration branch from c445b85 to bef2c05 Compare May 2, 2026 18:25
Comment thread pkg/querier/http.go
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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.

Comment thread pkg/querier/timeline/calculator.go
@manab-pr
Copy link
Copy Markdown
Author

manab-pr commented May 2, 2026

@simonswine please review it.

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.

2 participants