Annotation Type EnablePrometheusEndpoint


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    @Import(io.prometheus.client.spring.boot.PrometheusEndpointConfiguration.class)
    public @interface EnablePrometheusEndpoint
    Enable an endpoint that exposes Prometheus metrics from its default collector.

    Usage:
    Just add this annotation to the main class of your Spring Boot application, e.g.:

    
     @SpringBootApplication
     @EnablePrometheusEndpoint
      public class Application {
    
        public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
        }
      }
     

    Configuration:
    You can customize this endpoint at runtime using the following spring properties:

    • endpoints.prometheus.id (default: "prometheus")
    • endpoints.prometheus.enabled (default: true)
    • endpoints.prometheus.sensitive (default: true)
    Author:
    Marco Aust, Eliezio Oliveira