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

Jeremy :

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.

mweirauch :

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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=420569&siteId=1