| Modifier and Type | Method | Description |
|---|---|---|
Tracing |
build() |
|
Tracing.Builder |
clock(Clock clock) |
Assigns microsecond-resolution timestamp source for operations like
Span.start(). |
Tracing.Builder |
currentTraceContext(CurrentTraceContext currentTraceContext) |
Responsible for implementing
Tracer.startScopedSpan(String), Tracer.currentSpanCustomizer(),
Tracer.currentSpan() and Tracer.withSpanInScope(Span). |
Tracing.Builder |
endpoint(zipkin2.Endpoint endpoint) |
Sets the
Endpoint of the local service being traced. |
Tracing.Builder |
errorParser(ErrorParser errorParser) |
|
Tracing.Builder |
localServiceName(String localServiceName) |
Controls the name of the service being traced, while still using a default site-local IP.
|
Tracing.Builder |
propagationFactory(Propagation.Factory propagationFactory) |
Controls how trace contexts are injected or extracted from remote requests, such as from http
headers.
|
Tracing.Builder |
sampler(Sampler sampler) |
Sampler is responsible for deciding if a particular trace should be "sampled", i.e.
|
Tracing.Builder |
spanReporter(zipkin2.reporter.Reporter<zipkin2.Span> reporter) |
Controls how spans are reported.
|
Tracing.Builder |
supportsJoin(boolean supportsJoin) |
True means the tracing system supports sharing a span ID between a
Span.Kind.CLIENT
and Span.Kind.SERVER span. |
Tracing.Builder |
traceId128Bit(boolean traceId128Bit) |
When true, new root spans will have 128-bit trace IDs.
|
public Tracing.Builder localServiceName(String localServiceName)
endpoint(Endpoint).localServiceName - name of the service being traced. Defaults to "unknown".public Tracing.Builder endpoint(zipkin2.Endpoint endpoint)
Endpoint of the local service being traced.
Defaults to a site local IP.
Use localServiceName when only effecting the service name.
public Tracing.Builder spanReporter(zipkin2.reporter.Reporter<zipkin2.Span> reporter)
AsyncReporter
which batches spans before sending to Zipkin.
The AsyncReporter includes a Sender, which is a driver for transports like
http, kafka and scribe.
For example, here's how to batch send spans via http:
spanReporter = AsyncReporter.create(URLConnectionSender.create("http://localhost:9411/api/v2/spans"));
tracingBuilder.spanReporter(spanReporter);
See https://github.com/openzipkin/zipkin-reporter-java
public Tracing.Builder clock(Clock clock)
Span.start().
Defaults to JRE-specific platform time.
Note: timestamps are read once per trace, then ticks thereafter.
This ensures there's no clock skew problems inside a single trace.
See Tracing.clock(TraceContext)
public Tracing.Builder sampler(Sampler sampler)
for temporary overridespublic Tracing.Builder currentTraceContext(CurrentTraceContext currentTraceContext)
Tracer.startScopedSpan(String), Tracer.currentSpanCustomizer(),
Tracer.currentSpan() and Tracer.withSpanInScope(Span).
By default a simple thread-local is used. Override to support other mechanisms or to synchronize with other mechanisms such as SLF4J's MDC.
public Tracing.Builder propagationFactory(Propagation.Factory propagationFactory)
B3Propagation.FACTORYpublic Tracing.Builder traceId128Bit(boolean traceId128Bit)
public Tracing.Builder supportsJoin(boolean supportsJoin)
Span.Kind.CLIENT
and Span.Kind.SERVER span. Defaults to true.
Set this to false when the tracing system requires the opposite. For example, if ultimately spans are sent to Amazon X-Ray or Google Stackdriver Trace, you should set this to false.
This is implicitly set to false when Propagation.Factory.supportsJoin() is false,
as in that case, sharing IDs isn't possible anyway.
Propagation.Factory.supportsJoin()public Tracing.Builder errorParser(ErrorParser errorParser)
public Tracing build()
Copyright © 2018 OpenZipkin. All rights reserved.