io.prometheus.client.spring.boot.EnablePrometheusEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simpleclient_spring_boot Show documentation
Show all versions of simpleclient_spring_boot Show documentation
Collect information from Spring Boot actuator.
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 {
}