public final class ZipkinFinishedSpanHandler extends FinishedSpanHandler
NOOP| Constructor | Description |
|---|---|
ZipkinFinishedSpanHandler(zipkin2.reporter.Reporter<zipkin2.Span> spanReporter,
ErrorParser errorParser,
String serviceName,
String ip,
int port) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
handle(TraceContext context,
MutableSpan span) |
This is invoked after a span is finished, allowing data to be modified or reported out of
process.
|
String |
toString() |
alwaysSampleLocalpublic ZipkinFinishedSpanHandler(zipkin2.reporter.Reporter<zipkin2.Span> spanReporter,
ErrorParser errorParser,
String serviceName,
String ip,
int port)
public boolean handle(TraceContext context, MutableSpan span)
FinishedSpanHandlerChanges to the input span are visible by later finished span handlers. One reason to change the input is to align tags, so that correlation occurs. For example, some may clean the tag "http.path" knowing downstream handlers such as zipkin reporting have the same value.
Returning false is the same effect as if Span.abandon() was called. Implementations
should be careful when returning false as it can lead to broken traces. Acceptable use cases
are when the span is a leaf, for example a client call to an uninstrumented database, or a
server call which is known to terminate in-process (for example, health-checks). Prefer an
instrumentation policy approach to this mechanism as it results in less overhead.
Implementations should not hold a reference to it after this method returns. This is to allow object recycling.
handle in class FinishedSpanHandlercontext - the trace context which is SamplingFlags.sampled() or SamplingFlags.sampledLocal(). This includes identifiers and potentially extra propagated data such as extended sampling configuration.span - a mutable object including all data recorded with span apis. Modifications are
visible to later handlers, including Zipkin.Copyright © 2018 OpenZipkin. All rights reserved.