Search code examples
javametricsprometheusmicrometer

Change prometheus endpoint using micrometer.io


I use micrometer metrics for prometheus and according to docs: http://micrometer.io/docs/prometheus#_configuring

A Spring Boot Actuator endpoint will be wired to /prometheus that presents a Prometheus scrape with the appropriate format.

How to wire it to another endpoint like /metrics?


Solution

  • You can change the endpoint using the normal Spring Boot Actuator mechanism like so:

    endpoints:
      prometheus:
        id: micrometheus
    

    Here is a reference to the Micrometer documentation of this.