heesung-sn commented on code in PR #19440:
URL: https://github.com/apache/pulsar/pull/19440#discussion_r1102253856
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/data/BrokerLoadData.java:
##########
@@ -187,4 +191,35 @@ public String toString(ServiceConfiguration conf) {
);
}
+ public List<Metrics> toMetrics(String advertisedBrokerAddress) {
+ var metrics = new ArrayList<Metrics>();
+ var dimensions = new HashMap<String, String>();
+ dimensions.put("metric", "loadBalancing");
+ dimensions.put("broker", advertisedBrokerAddress);
Review Comment:
@codelipenghui
I see the following metrics currently emit `broker` label.
```
curl http://localhost:8080/metrics/ |grep broker=
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left Speed
100 99144 0 99144 0 0 1739k 0 --:--:-- --:--:-- --:--:--
2060k
pulsar_active_connections{cluster="standalone", broker="localhost",
metric="broker_connection"} 2
pulsar_connection_closed_total_count{cluster="standalone",
broker="localhost", metric="broker_connection"} 0
pulsar_connection_create_fail_count{cluster="standalone",
broker="localhost", metric="broker_connection"} 0
pulsar_connection_create_success_count{cluster="standalone",
broker="localhost", metric="broker_connection"} 2
pulsar_connection_created_total_count{cluster="standalone",
broker="localhost", metric="broker_connection"} 2
pulsar_lb_bandwidth_in_usage{cluster="standalone", broker="localhost",
metric="loadBalancing"} 0.0
pulsar_lb_bandwidth_out_usage{cluster="standalone", broker="localhost",
metric="loadBalancing"} 0.0
pulsar_lb_cpu_usage{cluster="standalone", broker="localhost",
metric="loadBalancing"} 0.0
pulsar_lb_directMemory_usage{cluster="standalone", broker="localhost",
metric="loadBalancing"} 26.953125
pulsar_lb_memory_usage{cluster="standalone", broker="localhost",
metric="loadBalancing"} 15.332031
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]