Skip to content

Fix/configurable min step duration#4536

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

Fix/configurable min step duration#4536
manab-pr wants to merge 5 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 step-size used for SelectSeries timeline queries and exposes it as a new config/flag, which can alter query load and UI resolution behavior across deployments.

Overview
Makes the timeline step calculation configurable by introducing querier.min-step-duration (default 15s) and plumbing it from querier.Config through module init and RegisterPyroscopeHandlers into the HTTP render path.

Updates timeline interval selection to use a new CalcPointIntervalWithMinInterval helper and adds tests covering custom minimum intervals (notably 1s and 5s) while keeping the existing default behavior unchanged.

Written by Cursor Bugbot for commit f96c301. This will update automatically on new commits. 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 .

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 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.

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.

f.API.RegisterQuerierServiceHandler(handler)
f.API.RegisterPyroscopeHandlers(handler)
f.API.RegisterQuerierServiceHandler(spanlogger.NewLogSpanParametersWrapper(queryFrontend, queryFrontendLogger))
f.API.RegisterPyroscopeHandlers(spanlogger.NewLogSpanParametersWrapper(queryFrontend, queryFrontendLogger), f.Cfg.Querier.MinStepDuration)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Diagnostics wrapper bypassed, handler variable now unused

High Severity

In initQueryFrontendV2, the old code registered both RegisterQuerierServiceHandler and RegisterPyroscopeHandlers with handler, which was the diagnostics.NewWrapper wrapping the spanlogger wrapping f.queryFrontend. The new code replaces handler with queryFrontend (which also lacks the f. prefix), completely bypassing the diagnostics wrapper layer. The handler variable on line 107 is now unused dead code, and query diagnostics tracking is silently lost for the V2 frontend path.

Additional Locations (1)
Fix in Cursor Fix in Web

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