-
Notifications
You must be signed in to change notification settings - Fork 808
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 source label to query stats metrics #6470
Add source label to query stats metrics #6470
Conversation
3f1344a
to
7b3c0a1
Compare
a5bde1a
to
b05ba9b
Compare
Signed-off-by: SungJin1212 <[email protected]>
b05ba9b
to
3b48b9c
Compare
source := tripperware.GetSource(r.Header.Get("User-Agent")) | ||
f.rejectedQueries.WithLabelValues(reasonRequestBodySizeExceeded, source, userID).Inc() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we allow any different "user-agent" as source, we may have cardinality problem that could cause metrics explosions.
Maybe we could just sub categorize the ruler UA and Others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source := tripperware.GetSource(r.Header.Get("User-Agent"))
GetSource
already categorizes it to API and Ruler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice! LGTM
This PR adds a
source
label to query stat metrics.Use case
When the user enables
-ruler.frontend-address
, the query stat metrics get changed whenever the ruler evaluates the rules. In other words, the query stat metrics are influenced byruler
andother source
even though the user wants to track the metrics only byother source
.This PR attaches the
source
label to address this situation.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]