tjiuming commented on a change in pull request #13833:
URL: https://github.com/apache/pulsar/pull/13833#discussion_r803327179
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java
##########
@@ -160,6 +171,52 @@ private static void
generateBrokerBasicMetrics(PulsarService pulsar, SimpleTextO
clusterName, Collector.Type.GAUGE, stream);
}
+
+ private static void generateLedgerOffloaderMetrics(PulsarService pulsar,
SimpleTextOutputStream stream,
+ boolean
includeTopicMetrics) {
+ List<Metrics> metricList = new LinkedList<>();
+ if (includeTopicMetrics) {
+
pulsar.getBrokerService().getMultiLayerTopicMap().forEach((namespace,
bundlesMap) -> {
+ bundlesMap.forEach((bundle, topicsMap) -> {
+ topicsMap.forEach((topicName, topic) -> {
+ if (topic instanceof PersistentTopic) {
+ //check offlaoder
+ PersistentTopic persistentTopic =
(PersistentTopic) topic;
+ LedgerOffloader offloader =
+
persistentTopic.getManagedLedger().getConfig().getLedgerOffloader();
+ if (!(offloader instanceof NullLedgerOffloader)) {
+ try {
+ List<Metrics> metrics =
+ new LedgerOffloaderMetrics(pulsar,
true, namespace, topicName).generate();
+ metricList.addAll(metrics);
+ } catch (Exception ex) {
+ log.error("generate ledger offloader topic
level metrics error", ex);
Review comment:
seems you are right, I will add topic name in the log.
--
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]