com.github.life.lab.leisure.common.metrics.configuration.CommonMetricsAutoConfigration Maven / Gradle / Ivy
package com.github.life.lab.leisure.common.metrics.configuration;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* CommonMetricsAutoConfigration
*
* @author weichao.li ([email protected])
* @date 2018/9/11
*/
@Configuration
public class CommonMetricsAutoConfigration {
@Value("${spring.application.name}")
private String applicationName;
@Bean
MeterRegistryCustomizer metricsCommonTags() {
return registry -> registry.config().commonTags("application", applicationName);
}
}