Skip to content

KAFKA-21016: Add client quota-utilization metrics (KIP-1373) - #23331

Draft
manangupta111 wants to merge 1 commit into
apache:trunkfrom
manangupta111:KAFKA-21016
Draft

KAFKA-21016: Add client quota-utilization metrics (KIP-1373)#23331
manangupta111 wants to merge 1 commit into
apache:trunkfrom
manangupta111:KAFKA-21016

Conversation

@manangupta111

Copy link
Copy Markdown
Contributor

Summary

  • Adds quota-utilization on the existing Produce, Fetch, and Request quota MBeans (no new sensor, ObjectName, or quota entity).
  • Value is measured-rate / effective-quota * 100 using the cached MetricConfig bound used for enforcement. It is not capped at 100; unlimited, missing, and non-positive bounds return NaN.
  • ControllerMutation is excluded (token-bucket enforcement does not match this rate-utilization definition).
  • Measurement does not call ClientQuotaCallback.quotaLimit().

Test plan

  • Unit tests
  • jmx metrics
$>domain kafka.server
#domain is set to kafka.server
$>bean kafka.server:type=Produce,client-id=mg-quota-load-test-client
#bean is set to kafka.server:type=Produce,client-id=mg-quota-load-test-client
$>info
#mbean = kafka.server:type=Produce,client-id=mg-quota-load-test-client
#class name = org.apache.kafka.common.metrics.JmxReporter$KafkaMbean
# attributes
  %0   - byte-rate (double, r)
  %1   - quota-utilization (double, r)
  %2   - throttle-time (double, r)
#there's no operations
#there's no notifications
$>get quota-utilization
#mbean = kafka.server:type=Produce,client-id=mg-quota-load-test-client:
quota-utilization = 21.582440162437226;

KIP-1373: Client Quota Utilization Metrics

@github-actions github-actions Bot added core Kafka Broker triage PRs from the community labels Sep 2, 2026
Expose produce, fetch, and request quota usage as a percentage of the
effective broker quota so operators can alert without resolving quota
overrides independently.

Co-authored-by: Cursor <cursoragent@cursor.com>
@manangupta111
manangupta111 marked this pull request as draft September 2, 2026 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant