|
9 | 9 | import datadog.trace.api.Config; |
10 | 10 | import datadog.trace.api.ProcessTags; |
11 | 11 | import datadog.trace.bootstrap.instrumentation.api.AgentTracer; |
12 | | -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; |
13 | 12 | import net.bytebuddy.asm.Advice; |
14 | 13 | import org.springframework.core.env.ConfigurableEnvironment; |
15 | 14 |
|
|
20 | 19 | @AutoService(InstrumenterModule.class) |
21 | 20 | public class SpringApplicationInstrumentation extends InstrumenterModule.Tracing |
22 | 21 | implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { |
23 | | - private static final CharSequence SPRING_BOOT = UTF8BytesString.create("spring-boot"); |
24 | 22 |
|
25 | 23 | public SpringApplicationInstrumentation() { |
26 | | - super(SPRING_BOOT.toString()); |
| 24 | + super("spring-boot"); |
27 | 25 | } |
28 | 26 |
|
29 | 27 | @Override |
@@ -63,7 +61,7 @@ public static void afterEnvironmentPostProcessed( |
63 | 61 |
|
64 | 62 | final String applicationName = environment.getProperty("spring.application.name"); |
65 | 63 | if (applicationName != null && !applicationName.isEmpty()) { |
66 | | - AgentTracer.get().updatePreferredServiceName(applicationName, SPRING_BOOT); |
| 64 | + AgentTracer.get().updatePreferredServiceName(applicationName, "spring-boot"); |
67 | 65 | ProcessTags.addTag("springboot.application", applicationName); |
68 | 66 | } |
69 | 67 | if (Config.get().isExperimentalPropagateProcessTagsEnabled()) { |
@@ -92,7 +90,7 @@ public static void afterEnvironmentPostProcessed( |
92 | 90 |
|
93 | 91 | final String applicationName = environment.getProperty("spring.application.name"); |
94 | 92 | if (applicationName != null && !applicationName.isEmpty()) { |
95 | | - AgentTracer.get().updatePreferredServiceName(applicationName, SPRING_BOOT); |
| 93 | + AgentTracer.get().updatePreferredServiceName(applicationName, "spring-boot"); |
96 | 94 | ProcessTags.addTag("springboot.application", applicationName); |
97 | 95 | } |
98 | 96 | if (Config.get().isExperimentalPropagateProcessTagsEnabled()) { |
|
0 commit comments