public class Trace extends Object
Constructor and Description |
---|
Trace() |
Modifier and Type | Method and Description |
---|---|
static void |
addKVAnnotation(byte[] key,
byte[] value)
Adds a data annotation to the current span if tracing is currently on.
|
static void |
addReceiver(SpanReceiver rcvr)
Adds the given SpanReceiver to the current Tracer instance's list of
SpanReceivers.
|
static void |
addTimelineAnnotation(String msg)
Annotate the current span with the given message.
|
static TraceScope |
continueSpan(Span s)
Pick up an existing span from another thread.
|
static Span |
currentSpan()
If we are tracing, return the current span, else null
|
static boolean |
isTracing()
Returns true if the current thread is a part of a trace, false otherwise.
|
static void |
removeReceiver(SpanReceiver rcvr)
Removes the given SpanReceiver from the list of SpanReceivers.
|
static void |
setProcessId(String processId)
Set the processId to be used for all Spans created by this Tracer.
|
static TraceScope |
startSpan(String description)
Starts and returns a new span as the child of the current span if the
default sampler (TrueIfTracingSampler) returns true, otherwise returns the
NullSpan.
|
static <T> TraceScope |
startSpan(String description,
Sampler<T> s) |
static <T> TraceScope |
startSpan(String description,
Sampler<T> s,
T info) |
static TraceScope |
startSpan(String description,
Sampler<TraceInfo> s,
TraceInfo tinfo) |
static TraceScope |
startSpan(String description,
Span parent)
Starts and returns a new span as the child of the parameter 'parent'.
|
static TraceScope |
startSpan(String description,
TraceInfo tinfo) |
static <V> Callable<V> |
wrap(Callable<V> callable)
Wrap the callable in a TraceCallable, if tracing.
|
static Runnable |
wrap(Runnable runnable)
Wrap the runnable in a TraceRunnable, if tracing
|
static Runnable |
wrap(String description,
Runnable runnable)
Wrap the runnable in a TraceRunnable, if tracing
|
public static TraceScope startSpan(String description)
description
- Description of the span to be created.public static TraceScope startSpan(String description, Span parent)
description
- Description of the span to be created.parent
- The parent that should be used to create the child span that is to
be returned.public static TraceScope startSpan(String description, TraceInfo tinfo)
public static <T> TraceScope startSpan(String description, Sampler<T> s)
public static TraceScope startSpan(String description, Sampler<TraceInfo> s, TraceInfo tinfo)
public static <T> TraceScope startSpan(String description, Sampler<T> s, T info)
public static TraceScope continueSpan(Span s)
public static void setProcessId(String processId)
processId
- Span.java
public static void removeReceiver(SpanReceiver rcvr)
rcvr
- public static void addReceiver(SpanReceiver rcvr)
rcvr
- public static void addKVAnnotation(byte[] key, byte[] value)
public static void addTimelineAnnotation(String msg)
public static boolean isTracing()
public static Span currentSpan()
public static <V> Callable<V> wrap(Callable<V> callable)
callable
- public static Runnable wrap(Runnable runnable)
runnable
- Copyright © 2014. All rights reserved.