use of org.apache.skywalking.apm.agent.core.sampling.SamplingService in project incubator-skywalking by apache.
the class ContextManager method createEntrySpan.
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.forceSampled();
context = getOrCreate(operationName, true);
span = context.createEntrySpan(operationName);
context.extract(carrier);
} else {
context = getOrCreate(operationName, false);
span = context.createEntrySpan(operationName);
}
return span;
}
Aggregations