Add source label to query stats metrics#6470
Merged
alanprot merged 1 commit intocortexproject:masterfrom Jan 10, 2025
Merged
Conversation
3f1344a to
7b3c0a1
Compare
CharlieTLe
approved these changes
Jan 3, 2025
a5bde1a to
b05ba9b
Compare
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
b05ba9b to
3b48b9c
Compare
alanprot
previously approved these changes
Jan 10, 2025
alanprot
reviewed
Jan 10, 2025
Comment on lines
+221
to
+222
| source := tripperware.GetSource(r.Header.Get("User-Agent")) | ||
| f.rejectedQueries.WithLabelValues(reasonRequestBodySizeExceeded, source, userID).Inc() |
Member
There was a problem hiding this comment.
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?
Contributor
There was a problem hiding this comment.
source := tripperware.GetSource(r.Header.Get("User-Agent"))
GetSource already categorizes it to API and Ruler
yeya24
approved these changes
Jan 10, 2025
3 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
sourcelabel 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 byrulerandother sourceeven though the user wants to track the metrics only byother source.This PR attaches the
sourcelabel to address this situation.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]