0

I use micrometer + spring boot + prometheus to create, register and monitor the counters from the application, apart from counters we have timer and gauge. counter created inside application which has the suffix "_total" counter type is not getting displayed, but for timer and gauge it is shown respectively. Please refer the image below for reference. counters are registered using MeterRegistry as below,

    Counter.builder(counterName)
           .description("Total Number of " + counterName)
           .tags(tags)
           .register(meterRegistry)
           .increment();

Prometheus Web Console Output

1
  • if your counterName = "My_event_total", micrometer will add suffix "_total", so it becomes "My_event_total_total" and prometheus may drop it. Try removing the "_total" suffix from counterName. Commented Jul 6 at 18:37

1 Answer 1

1

total is a "reserved word" / "invalid suffix" for Prometheus, see: https://github.com/micrometer-metrics/micrometer/wiki/1.13-Migration-Guide#invalid-meter-suffixes

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.