verminity opened a new issue #8616:
URL: https://github.com/apache/pulsar/issues/8616


   #### Expected behavior
   
   According to the [Prometheus text format 
documentation](https://prometheus.io/docs/instrumenting/exposition_formats/)
   
   > If the token is TYPE, exactly two more tokens are expected. The first is 
the metric name, and the second is either counter, gauge, histogram, summary, 
or untyped, defining the type for the metric of that name. **Only one TYPE line 
may exist for a given metric name.**
   
   It is expected that each `# TYPE` line returned by /metrics is unique
   
   #### Actual behavior
   
   When a cluster has more than one tenant some pulsar_ml metrics types appear 
more than once on /metrics
   
   The issue does not exist on Pulsar 2.5.1 and appears to have been introduced 
with "Expose managedLedgerCache, managedLedger, loadBalance metrics to 
Prometheus #6705 " in 2.6.0
   
   #### Steps to reproduce
   
   [Start a standalone Pulsar in 
Docker](https://pulsar.apache.org/docs/en/standalone-docker/#start-pulsar-in-docker)
   Create a tenant
   Create a namespace below that tenant
   Create a persistent topic on that namespace
   GET http://localhost:8080/metrics
   Search the response for `# TYPE pulsar_ml_AddEntryBytesRate gauge` and 
you'll find two results (there are a number of duplicated types)
   
   The impact of this is trying to use Telegraf to read this metrics causes the 
following error:
   `Error in plugin: error reading metrics for http://localhost:8080/metrics: 
reading text format failed: second TYPE line for metric name 
"pulsar_ml_AddEntryBytesRate", or TYPE reported after samples` and most metrics 
are dropped
   
   
   #### System configuration
   **Pulsar version**: 2.6.2
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to