Created
January 2, 2019 06:01
-
-
Save foamdino/5a008dc34e73df718319a4b109f9e4ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.thehutgroup.bootstarters.metrics | |
| import io.micrometer.core.instrument.MeterRegistry | |
| import io.micrometer.spring.autoconfigure.MeterRegistryCustomizer | |
| import org.springframework.beans.factory.annotation.Value | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| @Configuration | |
| open class MetricsConfiguration(@Value("\${aws.region}") val region: String, | |
| @Value("\${info.build.version}") val buildVersion: String, | |
| @Value("\${environment}") val environment: String) { | |
| @Bean | |
| fun commonTags() : MeterRegistryCustomizer<MeterRegistry> { | |
| return MeterRegistryCustomizer { | |
| registry -> registry.config().commonTags( | |
| "region", region, | |
| "buildVersion", buildVersion, | |
| "environment", environment) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment