-
Notifications
You must be signed in to change notification settings - Fork 56
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
[LI-HOTFIX] Add quota bound sensor #122
base: 2.4-li
Are you sure you want to change the base?
Conversation
def nullResultAsNone[X, Y](f: X => Y): X => Option[Y] = (x: X) => Option(f(x)) | ||
// Quotas may 1) not be configured or 2) not be applicable to all metrics, | ||
// so it's necessary to check for the bound's validity beforehand | ||
def quotaBound = |
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.
Since the clientMetric.config may have a null quota field, but the quota's bound field should always be available, can we simply check if the clientclientMetric.config.quota field is null or not?
We should always report even if its value is 0. Also, we shouldn't worry about the isNaN case.
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 think you're right on 0. Fixed it.
But I think NaN is a safety check here so I still kept it.
Thanks for the PR @lmr3796 |
@gitlw I've also added utilization rate |
5ee8da1
to
8039f6b
Compare
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.
Thanks for this change!
194596b
to
0d36932
Compare
0d36932
to
ecc1526
Compare
This patch adds QuotaBound sensor and QuotaUtilization sensor, in addition to the existing byte-rate & throttle-count sensors. The QuotaBound sensor records the value of of `org.apache.kafka.common.metrics.Quota#bound` if it exists. This process happens on the `kafka.server.ClientQuotaManager#recordAndGetThrottleTimeMs` code path, where quota check actually takes place. TICKET = N/A LI_DESCRIPTION = LIKAFKA-35289 EXIT_CRITERIA = When upstream implement similar sensors
ecc1526
to
51cf430
Compare
This patch adds QuotaBound sensor and QuotaUtilization sensor, in
addition to the existing byte-rate & throttle-count sensors.
The QuotaBound sensor records the value of of
org.apache.kafka.common.metrics.Quota#bound
if it exists.This process happens on the
kafka.server.ClientQuotaManager#recordAndGetThrottleTimeMs
code path,where quota check actually takes place.
TICKET = N/A
LI_DESCRIPTION = LIKAFKA-35289
EXIT_CRITERIA = When upstream implement similar sensors