Skip to content

Track data selection time range in query stats independent of query priority and rejection#7724

Open
yeya24 wants to merge 2 commits into
cortexproject:masterfrom
yeya24:fix/data-select-time-tracking
Open

Track data selection time range in query stats independent of query priority and rejection#7724
yeya24 wants to merge 2 commits into
cortexproject:masterfrom
yeya24:fix/data-select-time-tracking

Conversation

@yeya24

@yeya24 yeya24 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

Previously, rejectQueryOrSetPriority returned early when both query priority and query rejection were disabled, so DataSelectMinTime and DataSelectMaxTime were never set in the request stats.

This PR moves the data selection time range tracking before the enabled checks so it is always set for query and query_range requests, regardless of whether query priority or query rejection is enabled. The min/max time is used by the query frontend handler for query stats logging (data_select_min_time / data_select_max_time).

Which issue(s) this PR fixes:

Fixes #6484

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/ updated with any needed changes (ran make doc, no changes)

…riority and rejection

Previously, rejectQueryOrSetPriority returned early when both query
priority and query rejection were disabled, so DataSelectMinTime and
DataSelectMaxTime were never set in the request stats. Track the data
selection time range for query and query_range requests regardless of
whether query priority or query rejection is enabled.

Fixes cortexproject#6484

Signed-off-by: Ben Ye <benye@amazon.com>
@dosubot dosubot Bot added the type/observability To help know what is going on inside Cortex label Jul 24, 2026
Signed-off-by: Ben Ye <benye@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M type/observability To help know what is going on inside Cortex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Query: Data selection time should be tracked independent of query priority

2 participants