diff options
Diffstat (limited to 'sw-server')
-rw-r--r-- | sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt index 2485a28f..f9167a1a 100644 --- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt +++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/SevenWonders.kt @@ -1,10 +1,13 @@ package org.luxons.sevenwonders.server +import io.micrometer.core.instrument.MeterRegistry +import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.autoconfigure.http.HttpMessageConverters import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.http.converter.json.KotlinSerializationJsonHttpMessageConverter +import java.net.InetAddress @SpringBootApplication class SevenWonders { @@ -13,6 +16,13 @@ class SevenWonders { fun additionalConverters(): HttpMessageConverters? { return HttpMessageConverters(KotlinSerializationJsonHttpMessageConverter()) } + + @Bean + fun metricsCommonTags(): MeterRegistryCustomizer<MeterRegistry>? = MeterRegistryCustomizer { registry -> + registry.config() + .commonTags("application", "SevenWonders") + .commonTags("instance", InetAddress.getLocalHost().hostAddress) + } } fun main(args: Array<String>) { |