/** * Create a new trace scope. * * If there are no scopes above the current scope, we will apply our * configured samplers. Otherwise, we will create a span only if this thread * is already tracing. */ public TraceScope newScope(String description) { TraceScope parentScope = threadLocalScope.get(); ThreadContext context = threadContext.get(); if (parentScope != null) { return newScopeImpl(context, description, parentScope); } if (!context.isTopLevel()) { context.pushScope(); return nullScope; } if (!sample()) { context.pushScope(); return nullScope; } return newScopeImpl(context, description); }
/** * Create a new trace scope. * * If there are no scopes above the current scope, we will apply our * configured samplers. Otherwise, we will create a trace Span only if this thread * is already tracing. * @param description The description of the new span to create. * @return The new trace scope. */ public TraceScope newScope(String description) { TraceScope parentScope = threadLocalScope.get(); ThreadContext context = threadContext.get(); if (parentScope != null) { return newScopeImpl(context, description, parentScope); } if (!context.isTopLevel()) { context.pushScope(); return nullScope; } if (!sample()) { context.pushScope(); return nullScope; } return newScopeImpl(context, description); }
/** * Create a new trace scope. * * If there are no scopes above the current scope, we will apply our * configured samplers. Otherwise, we will create a trace Span only if this thread * is already tracing. * @param description The description of the new span to create. * @return The new trace scope. */ public TraceScope newScope(String description) { TraceScope parentScope = threadLocalScope.get(); ThreadContext context = threadContext.get(); if (parentScope != null) { return newScopeImpl(context, description, parentScope); } if (!context.isTopLevel()) { context.pushScope(); return nullScope; } if (!sample()) { context.pushScope(); return nullScope; } return newScopeImpl(context, description); }
if (parentId.isValid() && (!parentId.equals(parentScope.getSpan().getSpanId()))) { return newScopeImpl(context, description, parentScope, parentId); } else { return newScopeImpl(context, description, parentScope); return newScopeImpl(context, description, parentId); return nullScope; return newScopeImpl(context, description);
if (parentId.isValid() && (!parentId.equals(parentScope.getSpan().getSpanId()))) { return newScopeImpl(context, description, parentScope, parentId); } else { return newScopeImpl(context, description, parentScope); return newScopeImpl(context, description, parentId); return nullScope; return newScopeImpl(context, description);
if (parentId.isValid() && (!parentId.equals(parentScope.getSpan().getSpanId()))) { return newScopeImpl(context, description, parentScope, parentId); } else { return newScopeImpl(context, description, parentScope); return newScopeImpl(context, description, parentId); return nullScope; return newScopeImpl(context, description);