Ming-Yen Chung created KAFKA-20199:
--------------------------------------

             Summary: Evaluate whether BrokerId metrics tag should be renamed 
to NodeId or split by role
                 Key: KAFKA-20199
                 URL: https://issues.apache.org/jira/browse/KAFKA-20199
             Project: Kafka
          Issue Type: Improvement
          Components: metrics
            Reporter: Ming-Yen Chung


In KRaft mode, controller-only nodes (process.roles=controller) expose metrics 
tagged with BrokerId, even though they are not brokers. This is because 
NodeToControllerChannelManagerImpl passes Map.of("BrokerId", 
String.valueOf(config.brokerId())) as the metrics tag to the Selector, 
regardless of the node's role.

On broker nodes, this produces metrics such as:
- kafka.server:type=alter-partition-metrics,BrokerId=\{brokerId}
- kafka.server:type=directory-assignments-metrics,BrokerId=\{brokerId}
- kafka.server:type=forwarding-metrics,BrokerId=\{brokerId}
- kafka.server:type=heartbeat-metrics,BrokerId=\{brokerId}

On controller-only nodes, this produces:
- kafka.server:type=registration-metrics,BrokerId=\{nodeId}

Options to consider:
1. Rename the tag to NodeId for all metrics
2. Keep BrokerId for broker metrics and use NodeId or ControllerId for 
controller metrics

This issue was identified during the discussion of 
[KIP-1232|https://cwiki.apache.org/confluence/x/Hgp3Fw] (Deprecate broker.id 
config).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to