boolean isNoop(TraceContext context) { if (finishedSpanHandler == FinishedSpanHandler.NOOP || noop.get()) return true; int flags = InternalPropagation.instance.flags(context); if ((flags & FLAG_SAMPLED_LOCAL) == FLAG_SAMPLED_LOCAL) return false; return (flags & FLAG_SAMPLED) != FLAG_SAMPLED; }
/** Converts the context to a Span object after decorating it for propagation */ public Span toSpan(TraceContext context) { if (context == null) throw new NullPointerException("context == null"); if (alwaysSampleLocal) { int flags = InternalPropagation.instance.flags(context); if ((flags & FLAG_SAMPLED_LOCAL) != FLAG_SAMPLED_LOCAL) { context = InternalPropagation.instance.withFlags(context, flags | FLAG_SAMPLED_LOCAL); } } // decorating here addresses join, new traces or children and ad-hoc trace contexts return _toSpan(propagationFactory.decorate(context)); }
/** * Called by methods which can accept externally supplied parent trace contexts: Ex. {@link * #newChild(TraceContext)} and {@link #startScopedSpanWithParent(String, TraceContext)}. This * implies the {@link TraceContext#localRootId()} could be zero, if the context was manually * created. */ TraceContext nextContext(TraceContext parent) { return nextContext( InternalPropagation.instance.flags(parent), parent.traceIdHigh(), parent.traceId(), parent.localRootId(), parent.spanId(), parent.extra() ); }
if (traceIdContext != null) { return _toSpan(nextContext( InternalPropagation.instance.flags(extracted.traceIdContext()), traceIdContext.traceIdHigh(), traceIdContext.traceId(), flags = InternalPropagation.instance.flags(implicitParent); traceIdHigh = implicitParent.traceIdHigh(); traceId = implicitParent.traceId(); extra = concatImmutableLists(extra, implicitParent.extra()); } else { flags = InternalPropagation.instance.flags(samplingFlags);
if (context == null) throw new NullPointerException("context == null"); if (!supportsJoin) return newChild(context); int flags = InternalPropagation.instance.flags(context); if (alwaysSampleLocal && (flags & FLAG_SAMPLED_LOCAL) != FLAG_SAMPLED_LOCAL) { flags |= FLAG_SAMPLED_LOCAL;
boolean isNoop(TraceContext context) { if (finishedSpanHandler == FinishedSpanHandler.NOOP || noop.get()) return true; int flags = InternalPropagation.instance.flags(context); if ((flags & FLAG_SAMPLED_LOCAL) == FLAG_SAMPLED_LOCAL) return false; return (flags & FLAG_SAMPLED) != FLAG_SAMPLED; }
/** Converts the context to a Span object after decorating it for propagation */ public Span toSpan(TraceContext context) { if (context == null) throw new NullPointerException("context == null"); if (alwaysSampleLocal) { int flags = InternalPropagation.instance.flags(context); if ((flags & FLAG_SAMPLED_LOCAL) != FLAG_SAMPLED_LOCAL) { context = InternalPropagation.instance.withFlags(context, flags | FLAG_SAMPLED_LOCAL); } } // decorating here addresses join, new traces or children and ad-hoc trace contexts return _toSpan(propagationFactory.decorate(context)); }
/** * Called by methods which can accept externally supplied parent trace contexts: Ex. {@link * #newChild(TraceContext)} and {@link #startScopedSpanWithParent(String, TraceContext)}. This * implies the {@link TraceContext#localRootId()} could be zero, if the context was manually * created. */ TraceContext nextContext(TraceContext parent) { return nextContext( InternalPropagation.instance.flags(parent), parent.traceIdHigh(), parent.traceId(), parent.localRootId(), parent.spanId(), parent.extra() ); }
if (traceIdContext != null) { return _toSpan(nextContext( InternalPropagation.instance.flags(extracted.traceIdContext()), traceIdContext.traceIdHigh(), traceIdContext.traceId(), flags = InternalPropagation.instance.flags(implicitParent); traceIdHigh = implicitParent.traceIdHigh(); traceId = implicitParent.traceId(); extra = concatImmutableLists(extra, implicitParent.extra()); } else { flags = InternalPropagation.instance.flags(samplingFlags);
if (context == null) throw new NullPointerException("context == null"); if (!supportsJoin) return newChild(context); int flags = InternalPropagation.instance.flags(context); if (alwaysSampleLocal && (flags & FLAG_SAMPLED_LOCAL) != FLAG_SAMPLED_LOCAL) { flags |= FLAG_SAMPLED_LOCAL;