All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.prometheus.client.spring.boot.EnablePrometheusEndpoint Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
package io.prometheus.client.spring.boot;

import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 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.: *


 * {@literal @}SpringBootApplication
 * {@literal @}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: *

    *
  • {@code endpoints.prometheus.id} (default: "prometheus")
  • *
  • {@code endpoints.prometheus.enabled} (default: {@code true})
  • *
  • {@code endpoints.prometheus.sensitive} (default: {@code true})
  • *
* * @author Marco Aust * @author Eliezio Oliveira */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Import(PrometheusEndpointConfiguration.class) public @interface EnablePrometheusEndpoint { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy