Jorge Esteban Quilcate Otoya created KAFKA-13744: ----------------------------------------------------
Summary: Quota metric tags are inconsistent Key: KAFKA-13744 URL: https://issues.apache.org/jira/browse/KAFKA-13744 Project: Kafka Issue Type: Bug Components: core, metrics Reporter: Jorge Esteban Quilcate Otoya Attachments: image-2022-03-15-16-57-12-583.png When enabling metrics for quotas the metrics apply to _all_ clients (see https://issues.apache.org/jira/browse/KAFKA-13742). Though, the tags are calculated depending on the quotas registered, and applied to all clients: [https://github.com/apache/kafka/blob/0b9a8bac36f16b5397e9ec3a0441758e4b60a384/core/src/main/scala/kafka/server/ClientQuotaManager.scala#L649-L694] This cause different metric tags result depending on which quota is registered first. For instance, if a quota is registered with userId and clientId, then metrics are tagged with both, though if then a quota is registered with only tagged with clientId, then all metrics are only tagged by clientId — even though user principal is available. !image-2022-03-15-16-57-12-583.png! I'd expect metrics to always contain both, if available — and simplify the logic here [https://github.com/apache/kafka/blob/0b9a8bac36f16b5397e9ec3a0441758e4b60a384/core/src/main/scala/kafka/server/ClientQuotaManager.scala#L649-L694]. -- This message was sent by Atlassian Jira (v8.20.1#820001)