TracingContextpublic class ThreadLocalTracingContext extends Object implements TracingContext
TracingContext uses a non-static ThreadLocal to store the current tracing stack, which will work
under ordinary circumstances to isolate spans associated with a single request from other concurrent requests. Using
a non-static ThreadLocal allows for the possibility of having multiple Tracer
instances working in the service at the same time, using the same threads, but working on different requests.| Constructor | Description |
|---|---|
ThreadLocalTracingContext() |
| Modifier and Type | Method | Description |
|---|---|---|
Deque<TracerSpan> |
get() |
Return the stack of spans in the current trace (for this service).
|
boolean |
isEmpty() |
Check whether the current Span stack if empty.
|
TracerSpan |
peekFirst() |
Grab the latest Span in the current stack without removing it.
|
TracerSpan |
peekLast() |
Grab the founding Span in the current stack without removing it.
|
TracerSpan |
pop() |
Pop the latest Span off the stack for the current service trace and return it.
|
void |
push(TracerSpan span) |
Add a new Span to the current service-scope of the trace.
|
int |
size() |
The size of the current span stack
|
public Deque<TracerSpan> get()
TracingContextget in interface TracingContextDeque of spans. Never null.public int size()
TracingContextsize in interface TracingContextpublic TracerSpan peekLast()
TracingContextpeekLast in interface TracingContextpublic TracerSpan peekFirst()
TracingContextpeekFirst in interface TracingContextpublic boolean isEmpty()
TracingContextisEmpty in interface TracingContextpublic void push(TracerSpan span)
TracingContextpush in interface TracingContextspan - The span to addpublic TracerSpan pop()
TracingContextpop in interface TracingContextCopyright © 2019–2020 Honeycomb. All rights reserved.