tjiuming commented on PR #13785:
URL: https://github.com/apache/pulsar/pull/13785#issuecomment-1179974851

   ```
   Exposers SHOULD avoid names that could be confused with the suffixes that 
text format sample metric names use.
   
   Suffixes for the respective types are:
   Counter: '_total', '_created'
   Summary: '_count', '_sum', '_created', '' (empty)
   Histogram: '_count', '_sum', '_bucket', '_created'
   GaugeHistogram: '_gcount', '_gsum', '_bucket'
   Info: '_info'
   Gauge: '' (empty)
   StateSet: '' (empty)
   Unknown: '' (empty)
   ```
   I saw this in 
https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md,
 a COUNTER needs `metrics_name_total` and `metrics_name_created`.  But, in 
prometheus COUNTER.java:
   ```
     @Override
     public List<MetricFamilySamples> collect() {
       List<MetricFamilySamples.Sample> samples = new 
ArrayList<MetricFamilySamples.Sample>(children.size());
       for(Map.Entry<List<String>, Child> c: children.entrySet()) {
         samples.add(new MetricFamilySamples.Sample(fullname + "_total", 
labelNames, c.getKey(), c.getValue().get(), c.getValue().getExemplar()));
         samples.add(new MetricFamilySamples.Sample(fullname + "_created", 
labelNames, c.getKey(), c.getValue().created() / 1000.0));
       }
       return familySamplesList(Type.COUNTER, samples);
     }
   ```
   counter metrics name will add `_total` suffix when collect, why should we 
change `pulsar_expired_token_count ` to `pulsar_expired_token_total`? 


-- 
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]

Reply via email to