Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cortex_query_samples_total metric #6142

Merged

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Aug 7, 2024

What this PR does:
Add a new per tenant metric called cortex_query_samples_total which contains the number of fetched samples for each query requests. It provides an accurate count of fetched samples for each tenants.
Which issue(s) this PR fixes:
Fixes #

Checklist

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

@SungJin1212 SungJin1212 force-pushed the add-query-samples-metric branch from 2454692 to e3ee864 Compare August 7, 2024 03:21
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Aug 7, 2024
@SungJin1212 SungJin1212 force-pushed the add-query-samples-metric branch from e3ee864 to 625dfb0 Compare August 7, 2024 03:22
@pull-request-size pull-request-size bot added size/XS and removed size/S labels Aug 7, 2024
@SungJin1212 SungJin1212 changed the title add cortex_query_samples_total metric Add cortex_query_samples_total metric Aug 7, 2024
@SungJin1212 SungJin1212 force-pushed the add-query-samples-metric branch 3 times, most recently from b10a60f to 7b247fc Compare August 7, 2024 04:47
@pull-request-size pull-request-size bot added size/M and removed size/XS labels Aug 7, 2024
@SungJin1212 SungJin1212 closed this Aug 7, 2024
@SungJin1212 SungJin1212 reopened this Aug 7, 2024
@SungJin1212
Copy link
Member Author

@yeya24 @alanprot could you please take a review?

yeya24
yeya24 previously approved these changes Aug 8, 2024
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Thanks

@@ -116,6 +117,11 @@ func NewHandler(cfg HandlerConfig, roundTripper http.RoundTripper, log log.Logge
Help: "Number of series fetched to execute a query.",
}, []string{"user"})

h.querySamples = promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
Name: "cortex_query_samples_total",
Help: "Number of samples to execute a query.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Number of samples fetched

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it. Thanks for the review. @yeya24

@yeya24 yeya24 self-requested a review August 8, 2024 05:48
@yeya24 yeya24 dismissed their stale review August 8, 2024 05:49

revoke

@SungJin1212 SungJin1212 force-pushed the add-query-samples-metric branch from 7b247fc to c13a766 Compare August 8, 2024 05:51
@alanprot
Copy link
Member

alanprot commented Aug 8, 2024

I like that! :)

@alanprot alanprot enabled auto-merge (squash) August 8, 2024 20:02
@alanprot alanprot merged commit a0704d3 into cortexproject:master Aug 8, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants