Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Spring Boot actuator have dot separated prometheus metrics names?

I'm using Spring Boot with micrometer, but it appears the metric name format is incorrect.

Spring boot version 2.1.4.RELEASE
and io.micrometer:micrometer-registry-prometheus:1.3.5

I get metrics back from http://localhost:8080/actuator/prometheus

But the metric names have dots instead of underscores.

When using the promtool for linting, I get this error message back -

error while linting: text format parsing error in line 1: invalid metric name in comment

Example metric output -

# HELP tomcat.global.request.max  
# TYPE tomcat.global.request.max gauge
tomcat.global.request.max{environment="development",host="local",name="http-nio-8080",service="mobile_backend",} 0.0

I'm not sure why this is happening, or how I change the separator to underscores.

like image 654
Jeremy Avatar asked Feb 02 '26 02:02

Jeremy


1 Answers

Make sure that you got no other NamingConvention implementation in place which replaces the original PrometheusNamingConvention for the PrometheusMeterRegistry.

like image 166
mweirauch Avatar answered Feb 04 '26 14:02

mweirauch