public class DDTracer
extends io.opentracing.util.ThreadLocalActiveSpanSource
implements io.opentracing.Tracer
| Modifier and Type | Class and Description |
|---|---|
class |
DDTracer.DDSpanBuilder
Spans are built using this builder
|
| Modifier and Type | Field and Description |
|---|---|
static String |
UNASSIGNED_DEFAULT_SERVICE_NAME |
static Sampler |
UNASSIGNED_SAMPLER |
static Writer |
UNASSIGNED_WRITER |
| Constructor and Description |
|---|
DDTracer()
Default constructor, trace/spans are logged, no trace/span dropped
|
DDTracer(String defaultServiceName,
Writer writer,
Sampler sampler) |
DDTracer(Writer writer) |
DDTracer(Writer writer,
Sampler sampler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDecorator(AbstractDecorator decorator)
Add a new decorator in the list (
AbstractDecorator) |
void |
addServiceInfo(Service service)
Register additional information about a service.
|
DDTracer.DDSpanBuilder |
buildSpan(String operationName) |
void |
close() |
<T> io.opentracing.SpanContext |
extract(io.opentracing.propagation.Format<T> format,
T carrier) |
Map<String,Service> |
getServiceInfo()
Return the list of additional service information registered
|
List<AbstractDecorator> |
getSpanContextDecorators(String tag)
Returns the list of span context decorators
|
<T> void |
inject(io.opentracing.SpanContext spanContext,
io.opentracing.propagation.Format<T> format,
T carrier) |
String |
toString() |
void |
write(Queue<DDBaseSpan<?>> trace)
We use the sampler to know if the trace has to be reported/written.
|
public static final String UNASSIGNED_DEFAULT_SERVICE_NAME
public static final Writer UNASSIGNED_WRITER
public static final Sampler UNASSIGNED_SAMPLER
public DDTracer()
public DDTracer(Writer writer)
public List<AbstractDecorator> getSpanContextDecorators(String tag)
public void addDecorator(AbstractDecorator decorator)
AbstractDecorator)decorator - The decorator in the listpublic DDTracer.DDSpanBuilder buildSpan(String operationName)
buildSpan in interface io.opentracing.Tracerpublic <T> void inject(io.opentracing.SpanContext spanContext,
io.opentracing.propagation.Format<T> format,
T carrier)
inject in interface io.opentracing.Tracerpublic <T> io.opentracing.SpanContext extract(io.opentracing.propagation.Format<T> format,
T carrier)
extract in interface io.opentracing.Tracerpublic void write(Queue<DDBaseSpan<?>> trace)
trace - a list of the spans related to the same tracepublic void close()
public void addServiceInfo(Service service)
service - additional service information