Skip to content

Add # of tracked request metric in query scheduler#7355

Open
SungJin1212 wants to merge 2 commits intocortexproject:masterfrom
SungJin1212:Add-pending-request-to-scheduler
Open

Add # of tracked request metric in query scheduler#7355
SungJin1212 wants to merge 2 commits intocortexproject:masterfrom
SungJin1212:Add-pending-request-to-scheduler

Conversation

@SungJin1212
Copy link
Member

Add a query scheduler metric cortex_query_scheduler_pending_requests to track the current number of requests held by the scheduler.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@dosubot dosubot bot added the type/observability To help know what is going on inside Cortex label Mar 16, 2026
@SungJin1212 SungJin1212 changed the title Add # of tracked req in schduler metric Add # of tracked request metric in query scheduler Mar 16, 2026
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

Thanks for doing this!

}, s.getConnectedFrontendClientsMetric)

s.pendingRequestsCurrent = promauto.With(registerer).NewGaugeFunc(prometheus.GaugeOpts{
Name: "cortex_query_scheduler_pending_requests",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Name: "cortex_query_scheduler_pending_requests",
Name: "cortex_query_scheduler_tracked_requests",

I believe this metric tracks pending and queries inflight. Pending gives the connotation that is not running yet.

Maybe renaming the map is also due

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it looks nice. I updated the PR with renaming.

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants