Skip to content

Commit ecbc412

Browse files
committed
Add property 'management.wavefront.trace-derived-custom-tag-keys'
Closes gh-34194
1 parent 0fc4741 commit ecbc412

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/wavefront/WavefrontTracingAutoConfiguration.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.boot.actuate.autoconfigure.tracing.wavefront;
1818

19-
import java.util.Collections;
20-
2119
import brave.handler.SpanHandler;
2220
import com.wavefront.sdk.common.WavefrontSender;
2321
import com.wavefront.sdk.common.application.ApplicationTags;
@@ -65,7 +63,7 @@ public class WavefrontTracingAutoConfiguration {
6563
WavefrontSpanHandler wavefrontSpanHandler(WavefrontProperties properties, WavefrontSender wavefrontSender,
6664
SpanMetrics spanMetrics, ApplicationTags applicationTags) {
6765
return new WavefrontSpanHandler(properties.getSender().getMaxQueueSize(), wavefrontSender, spanMetrics,
68-
properties.getSourceOrDefault(), applicationTags, Collections.emptySet());
66+
properties.getSourceOrDefault(), applicationTags, properties.getTraceDerivedCustomTagKeys());
6967
}
7068

7169
@Configuration(proxyBeanMethods = false)

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/wavefront/WavefrontProperties.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
2020
import java.net.URI;
2121
import java.net.UnknownHostException;
2222
import java.time.Duration;
23+
import java.util.HashSet;
24+
import java.util.Set;
2325

2426
import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.PushRegistryProperties;
2527
import org.springframework.boot.context.properties.ConfigurationProperties;
@@ -68,6 +70,11 @@ public class WavefrontProperties {
6870
*/
6971
private final Metrics metrics = new Metrics();
7072

73+
/**
74+
* Customized span tags for RED metrics.
75+
*/
76+
private Set<String> traceDerivedCustomTagKeys = new HashSet<>();
77+
7178
public Application getApplication() {
7279
return this.application;
7380
}
@@ -150,6 +157,14 @@ private boolean usesProxy() {
150157
return "proxy".equals(this.uri.getScheme());
151158
}
152159

160+
public Set<String> getTraceDerivedCustomTagKeys() {
161+
return this.traceDerivedCustomTagKeys;
162+
}
163+
164+
public void setTraceDerivedCustomTagKeys(Set<String> traceDerivedCustomTagKeys) {
165+
this.traceDerivedCustomTagKeys = traceDerivedCustomTagKeys;
166+
}
167+
153168
public static class Application {
154169

155170
/**

0 commit comments

Comments
 (0)