Description
Quota metrics are loaded only when at least one quota is present:
- Metrics: https://github.com/apache/kafka/blob/0b9a8bac36f16b5397e9ec3a0441758e4b60a384/core/src/main/scala/kafka/server/ClientQuotaManager.scala#L552-L563
- Reporting when quotas are enabled: https://github.com/apache/kafka/blob/0b9a8bac36f16b5397e9ec3a0441758e4b60a384/core/src/main/scala/kafka/server/ClientQuotaManager.scala#L249-L256
- Quotas enabled: `def quotasEnabled: Boolean = quotaTypesEnabled != QuotaTypes.NoQuotas`
Even though throttling is specific for quotas, byte-rate/request per user/client-id is a valid metric for any deployment.
The current workaround is to add any quota, as this will enable metrics for all client-id/users.
If these metrics are captured for all clients regardless of the quotas created, it would be a better experience to have a config to opt-in into these metrics instead of creating meaningless quotas just to get these metrics.
For threshold metrics, it makes sense to me to enable them only when quotas are enabled.