-
Notifications
You must be signed in to change notification settings - Fork 805
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 global-ratelimiter aggregator-side metrics #6171
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
... and 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
Overall, it looks good. I think part of metrics verification can be done in unit tests, but that is not widely used in the repo.
@@ -1729,7 +1731,8 @@ var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{ | |||
HashringScope: {operation: "Hashring"}, | |||
|
|||
// currently used by both frontend and history, but may grow to other limiting-host-services. | |||
FrontendGlobalRatelimiter: {operation: "GlobalRatelimiter"}, | |||
GlobalRatelimiter: {operation: "GlobalRatelimiter"}, |
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.
I suggest using lower-case. m3 lowercase everything, and usage of CamelCase makes it harder to find metrics.
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.
I mostly agree, lower-case is nicer for lots of things, but all of our "operation" tags are title-case at the moment. Not sure there's much benefit to breaking that long-held pattern.
is it just for code-grepping difficulty, or does it make metric-querying harder somehow?
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.
(this is pretty easy to change if we do want to change things later, nothing we have now depends on this for monitoring/log search/etc)
@@ -538,3 +578,18 @@ func weighted[T numeric](newer, older T, weight float64) T { | |||
type numeric interface { | |||
constraints.Integer | constraints.Float | |||
} | |||
|
|||
// non-sync version of sync.Once, for easier unlocking |
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.
I'd make it explicit in the comments there "Do NOT use this for concurrent cases"
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.
that is part of why I didn't make it a public type, yea. not intended for reuse.
It would've been useful to have some of these while checking the initial rollout and troubleshooting, and the rest seem possibly-also-useful and easy to collect. I've also adjusted the histogram buckets shared by other global ratelimiter stuff - nothing is planned that will be actually sensitive to the values, so this should be harmless. It's more for general "wait why do we have 100x more/fewer than we expected"-style discoveries.
It would've been useful to have some of these while checking the initial rollout and troubleshooting, and the rest seem possibly-also-useful and easy to collect.
I've also adjusted the histogram buckets shared by other global ratelimiter stuff - nothing is planned that will be actually sensitive to the values, so this should be harmless. It's more for general "wait why do we have 100x more/fewer than we expected"-style discoveries.