Skip to content

feat(ingester): Add "source" pprof label to all query methods#7494

Merged
danielblando merged 2 commits intocortexproject:masterfrom
danielblando:feat/pprof-caller-label
May 8, 2026
Merged

feat(ingester): Add "source" pprof label to all query methods#7494
danielblando merged 2 commits intocortexproject:masterfrom
danielblando:feat/pprof-caller-label

Conversation

@danielblando
Copy link
Copy Markdown
Contributor

@danielblando danielblando commented May 8, 2026

Add GetSource() to requestmeta and use it as a pprof label in all ingester pprof.Do sites (QueryStream, LabelValues, LabelNames, MetricsForLabelMatchers, MetricsMetadata, QueryExemplars). The ruler already sets source="ruler" via ContextWithRequestSource; queries without a source show as "unknown".

Usage:
go tool pprof -tagfocus="source:ruler" profile.pb.gz
go tool pprof -tagfocus="source:unknown" profile.pb.gz

What this PR does:

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]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

@dosubot dosubot Bot added component/ingester type/feature type/observability To help know what is going on inside Cortex labels May 8, 2026
Add GetSource() to requestmeta and use it as a pprof label in all
ingester pprof.Do sites (QueryStream, LabelValues, LabelNames,
MetricsForLabelMatchers, MetricsMetadata, QueryExemplars). The ruler
already sets source="ruler" via ContextWithRequestSource; queries
without a source show as "unknown".

Usage:
  go tool pprof -tagfocus="source:ruler" profile.pb.gz
  go tool pprof -tagfocus="source:unknown" profile.pb.gz
Signed-off-by: Daniel Blando <ddeluigg@amazon.com>
@danielblando danielblando force-pushed the feat/pprof-caller-label branch from 8bce4b8 to b5889c0 Compare May 8, 2026 18:19
Signed-off-by: Daniel Blando <ddeluigg@amazon.com>
Copy link
Copy Markdown
Member

@alanprot alanprot left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 8, 2026
@danielblando danielblando merged commit 2c60463 into cortexproject:master May 8, 2026
37 checks passed
@danielblando danielblando deleted the feat/pprof-caller-label branch May 8, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ingester lgtm This PR has been approved by a maintainer size/M type/feature type/observability To help know what is going on inside Cortex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants