All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.life.lab.leisure.common.metrics.configuration.CommonMetricsAutoConfigration Maven / Gradle / Ivy

There is a newer version: 0.0.12.RELEASE
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy