Conversation
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
2ae2a29 to
f2ac98a
Compare
|
@simonswine Sorry about that! I accidentally included changes from #4526 when I started |
|
@simonswine The branch has been rebased and is ready for another look. Could you please review when you get a chance? Thanks. |
| 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) |
There was a problem hiding this comment.
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.


Note
Medium Risk
Changes the step-size used for
SelectSeriestimeline 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(default15s) and plumbing it fromquerier.Configthrough module init andRegisterPyroscopeHandlersinto the HTTP render path.Updates timeline interval selection to use a new
CalcPointIntervalWithMinIntervalhelper and adds tests covering custom minimum intervals (notably1sand5s) while keeping the existing default behavior unchanged.Written by Cursor Bugbot for commit f96c301. This will update automatically on new commits. Configure here.