diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfiguration.java index e58316419d..81a0dd0863 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,6 @@ package org.springframework.boot.actuate.autoconfigure.tracing.wavefront; -import java.util.Collections; - import brave.handler.SpanHandler; import com.wavefront.sdk.common.WavefrontSender; import com.wavefront.sdk.common.application.ApplicationTags; @@ -65,7 +63,7 @@ public class WavefrontTracingAutoConfiguration { WavefrontSpanHandler wavefrontSpanHandler(WavefrontProperties properties, WavefrontSender wavefrontSender, SpanMetrics spanMetrics, ApplicationTags applicationTags) { return new WavefrontSpanHandler(properties.getSender().getMaxQueueSize(), wavefrontSender, spanMetrics, - properties.getSourceOrDefault(), applicationTags, Collections.emptySet()); + properties.getSourceOrDefault(), applicationTags, properties.getTraceDerivedCustomTagKeys()); } @Configuration(proxyBeanMethods = false) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/wavefront/WavefrontProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/wavefront/WavefrontProperties.java index 73f2721db5..2157cc1483 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/wavefront/WavefrontProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/wavefront/WavefrontProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,8 @@ import java.net.InetAddress; import java.net.URI; import java.net.UnknownHostException; import java.time.Duration; +import java.util.HashSet; +import java.util.Set; import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.PushRegistryProperties; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -68,6 +70,11 @@ public class WavefrontProperties { */ private final Metrics metrics = new Metrics(); + /** + * Customized span tags for RED metrics. + */ + private Set traceDerivedCustomTagKeys = new HashSet<>(); + public Application getApplication() { return this.application; } @@ -150,6 +157,14 @@ public class WavefrontProperties { return "proxy".equals(this.uri.getScheme()); } + public Set getTraceDerivedCustomTagKeys() { + return this.traceDerivedCustomTagKeys; + } + + public void setTraceDerivedCustomTagKeys(Set traceDerivedCustomTagKeys) { + this.traceDerivedCustomTagKeys = traceDerivedCustomTagKeys; + } + public static class Application { /**