public abstract class Tracing extends Object implements Closeable
Tracer
.
Instances built via newBuilder()
are registered automatically such that statically
configured instrumentation like JDBC drivers can use current()
.
This type can be extended so that the object graph can be built differently or overridden, for example via spring or when mocking.
Modifier and Type | Class and Description |
---|---|
static class |
Tracing.Builder |
Constructor and Description |
---|
Tracing() |
Modifier and Type | Method and Description |
---|---|
abstract Clock |
clock()
This exposes the microsecond clock used by operations such as
Span.finish() . |
abstract void |
close()
Ensures this component can be garbage collected, by making it not
current() |
static Tracing |
current()
Returns the most recently created tracing component iff it hasn't been closed.
|
abstract CurrentTraceContext |
currentTraceContext()
This supports in-process propagation, typically across thread boundaries.
|
static Tracer |
currentTracer()
Returns the most recently created tracer iff its component hasn't been closed.
|
static Tracing.Builder |
newBuilder() |
Propagation<String> |
propagation()
When a trace leaves the process, it needs to be propagated, usually via headers.
|
abstract Propagation.Factory |
propagationFactory()
This supports edge cases like GRPC Metadata propagation which doesn't use String keys.
|
abstract Tracer |
tracer()
All tracing commands start with a
Span . |
public static Tracing.Builder newBuilder()
public abstract Tracer tracer()
Span
. Use a tracer to create spans.public Propagation<String> propagation()
public abstract Propagation.Factory propagationFactory()
public abstract CurrentTraceContext currentTraceContext()
public abstract Clock clock()
Span.finish()
. This is
helpful when you want to time things manually.@Nullable public static Tracer currentTracer()
This object should not be cached.
@Nullable public static Tracing current()
This object should not be cached.
public abstract void close()
current()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2017 OpenZipkin. All rights reserved.