call.traceScope.reattach(); traceScope = call.traceScope; traceScope.getSpan().addTimelineAnnotation("called"); LOG.info(Thread.currentThread().getName() + " unexpectedly interrupted", e); if (traceScope != null) { traceScope.getSpan().addTimelineAnnotation("unexpectedly interrupted: " + StringUtils.stringifyException(e)); LOG.info(Thread.currentThread().getName() + " caught an exception", e); if (traceScope != null) { traceScope.getSpan().addTimelineAnnotation("Exception: " + StringUtils.stringifyException(e));
TraceUtil.addSampler(loopSampler); for (int i = 0; i < numIterations; ++i) { assert Tracer.getCurrentSpan() == threadScope.getSpan() : "Span leak detected."; try (TraceScope loopScope = TraceUtil.createTrace("runLoopIter" + i)) { long now = System.nanoTime();
try (TraceScope scope = TraceUtil.createTrace(getSpanName())) { if (scope != null) { span = scope.getSpan();
public static Span getCurrentSpan() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return null; } else { return curScope.getSpan(); } }
public static Span getCurrentSpan() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return null; } else { return curScope.getSpan(); } }
public static Span getCurrentSpan() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return null; } else { return curScope.getSpan(); } }
public static SpanId getCurrentSpanId() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return SpanId.INVALID; } else { return curScope.getSpan().getSpanId(); } }
public static SpanId getCurrentSpanId() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return SpanId.INVALID; } else { return curScope.getSpan().getSpanId(); } }
public static SpanId getCurrentSpanId() { TraceScope curScope = threadLocalScope.get(); if (curScope == null) { return SpanId.INVALID; } else { return curScope.getSpan().getSpanId(); } }
@Override public void run() { TraceScope chunk = tracer.newScope(description, parent.getSpan().getSpanId()); try { runnable.run(); } finally { chunk.close(); } }
@Override public V call() throws Exception { TraceScope chunk = tracer.newScope(description, parent.getSpan().getSpanId()); try { return impl.call(); } finally { chunk.close(); } }
void detachScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't detach TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); }
void detachScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't detach TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); }
void detachScope(TraceScope scope) { TraceScope curScope = threadLocalScope.get(); if (curScope != scope) { throwClientError("Can't detach TraceScope for " + scope.getSpan().toJson() + " because it is not the current " + "TraceScope in thread " + Thread.currentThread().getName()); } ThreadContext context = threadContext.get(); context.popScope(); threadLocalScope.set(scope.getParent()); }
private TraceScope newScopeImpl(ThreadContext context, String description, TraceScope parentScope) { SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). begin(System.currentTimeMillis()). description(description). parents(new SpanId[] { parentId }). spanId(parentId.newChildId()). build(); return context.pushNewScope(this, span, parentScope); }
private TraceScope newScopeImpl(ThreadContext context, String description, TraceScope parentScope, SpanId secondParentId) { SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). begin(System.currentTimeMillis()). description(description). parents(new SpanId[] { parentId, secondParentId }). spanId(parentId.newChildId()). build(); return context.pushNewScope(this, span, parentScope); }
private TraceScope newScopeImpl(ThreadContext context, String description, TraceScope parentScope) { SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). begin(System.currentTimeMillis()). description(description). parents(new SpanId[] { parentId }). spanId(parentId.newChildId()). build(); return context.pushNewScope(this, span, parentScope); }
private TraceScope newScopeImpl(ThreadContext context, String description, TraceScope parentScope, SpanId secondParentId) { SpanId parentId = parentScope.getSpan().getSpanId(); Span span = new MilliSpan.Builder(). tracerId(tracerId). begin(System.currentTimeMillis()). description(description). parents(new SpanId[] { parentId, secondParentId }). spanId(parentId.newChildId()). build(); return context.pushNewScope(this, span, parentScope); }