io.prometheus.client.spring.boot.PrometheusMetricsConfiguration 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 java.util.Collection;
import org.springframework.boot.actuate.endpoint.PublicMetrics;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
class PrometheusMetricsConfiguration {
@Bean
public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) {
SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector(publicMetrics);
springBootMetricsCollector.register();
return springBootMetricsCollector;
}
}