You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/22 13:22:37 UTC

[GitHub] [pulsar] rcastagnet opened a new issue #4337: Duplicate metrics Prometheus

rcastagnet opened a new issue #4337: Duplicate metrics Prometheus
URL: https://github.com/apache/pulsar/issues/4337
 
 
   **Describe the bug**
   The default metrics stay present even though there is an other metrics with more information.
   Prometheus only processes this default metric.
   
   **To Reproduce**
   * Produce and consumer on your cluster
   * Do a curl on metrics url : 
   ```
   curl -s server01:8080/metrics/ | grep -e pulsar_consumers_count
   ```
   * The result :
   ```
   pulsar_consumers_count{cluster="pulsar_bdx"} 0 1558518241858
   pulsar_consumers_count{cluster="pulsar_bdx",namespace="ns/global",topic="persistent://ns/global/queue"} 1.0 1558518241859
   ```
   * Next, in prometheus you find only :
   ```
   pulsar_consumers_count{cluster="pulsar_bdx",instance="server01:8080",job="Pulsar-broker-exporter"} 0
   ```
   
   **Expected behavior**
   
   * In Prometheus, you should find :
   ```
   pulsar_consumers_count{cluster="pulsar_bdx",instance="server01:8080",job="Pulsar-broker-exporter",namespace="ns/global",topic="persistent://ns/global/queue1"} 1
   ```
   
   **Additional context**
   
   In my test, I solved this problem by commenting on the next line of the file "pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/NamespaceStatsAggregator.java" :
   ```
   // printDefaultBrokerStats(stream, cluster);
   ```
   An other solution should be the next line (I didn't try yet) :
   ```
   if (pulsar.getBrokerService().getMultiLayerTopicMap().isEmpty()) {
       printDefaultBrokerStats(stream, cluster);
   }
   ```
   
   
   Why do these metrics remain constantly instead of being overrided by new values?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services