Skip to content

Commit

Permalink
Adjust service name for non legacy tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
amarziali committed Dec 9, 2024
1 parent 5cadf9c commit 25ff224
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package datadog.trace.api.naming.v0;

import datadog.trace.api.Config;
import datadog.trace.api.naming.ClassloaderServiceNames;
import datadog.trace.api.naming.NamingSchema;
import datadog.trace.api.remoteconfig.ServiceNameCollector;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -46,6 +47,11 @@ public String inboundService(@Nonnull final String messagingSystem, boolean useL
ServiceNameCollector.get().addService(messagingSystem);
return messagingSystem;
} else {
final String contextual = ClassloaderServiceNames.maybeGetForThread(Thread.currentThread());
if (contextual != null) {
ServiceNameCollector.get().addService(contextual);
return contextual;
}
return Config.get().getServiceName();
}
} else {
Expand Down

0 comments on commit 25ff224

Please sign in to comment.