diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java index 90ffdb19a..206cb6845 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java @@ -87,10 +87,10 @@ public class ContextManager implements BootService { } public static AbstractSpan createEntrySpan(String operationName, ContextCarrier carrier) { - SamplingService samplingService = ServiceManager.INSTANCE.findService(SamplingService.class); AbstractSpan span; AbstractTracerContext context; if (carrier != null && carrier.isValid()) { + SamplingService samplingService = ServiceManager.INSTANCE.findService(SamplingService.class); samplingService.forceSampled(); context = getOrCreate(operationName, true); span = context.createEntrySpan(operationName);