![JAR search and dependency download from the Maven repository](/logo.png)
ru.vyukov.prometheus.starter.PrometheusEndpointConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-prometheus Show documentation
Show all versions of spring-boot-starter-prometheus Show documentation
Metrics endpoint prometheus.io format for Spring Boot
The newest version!
package ru.vyukov.prometheus.starter;
import java.util.Collection;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.PublicMetrics;
import org.springframework.boot.actuate.health.HealthAggregator;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class PrometheusEndpointConfiguration {
@Bean
@ConditionalOnMissingBean
@Autowired
public PrometheusEndpoint prometheusEndpoint(Collection publicMetrics,
PrometeusMetricNameConverter prometeusMetricNameConverter, Map healthIndicators,
HealthAggregator healthAggregator) {
return new PrometheusEndpoint(publicMetrics, prometeusMetricNameConverter, healthIndicators, healthAggregator);
}
@Bean
public PrometheusMvcEndpoint prometheusMvcEndpoint(PrometheusEndpoint prometheusEndpoint) {
return new PrometheusMvcEndpoint(prometheusEndpoint);
}
@Bean
public PrometeusMetricNameConverter prometeusMetricNameConverter() {
return new DefaultPrometeusMetricNameConverter();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy