tech.jhipster.config.metric.JHipsterMetricsEndpointConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jhipster-framework Show documentation
Show all versions of jhipster-framework Show documentation
Server-side library used by applications created with the BegCode generator, see https://www.begcode.com/ for more information on BegCode
package tech.jhipster.config.metric;
import io.micrometer.core.annotation.Timed;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* JHipsterMetricsEndpointConfiguration class.
*/
@Configuration
@ConditionalOnClass(Timed.class)
@AutoConfigureAfter(MetricsEndpointAutoConfiguration.class)
public class JHipsterMetricsEndpointConfiguration {
/**
* jHipsterMetricsEndpoint.
*
* @param meterRegistry a {@link io.micrometer.core.instrument.MeterRegistry} object.
* @return a {@link JHipsterMetricsEndpoint} object.
*/
@Bean
@ConditionalOnBean({MeterRegistry.class})
@ConditionalOnMissingBean
@ConditionalOnAvailableEndpoint
public JHipsterMetricsEndpoint jHipsterMetricsEndpoint(MeterRegistry meterRegistry) {
return new JHipsterMetricsEndpoint(meterRegistry);
}
}