public interface ZipkinSpanSender
extends java.io.Flushable
A interface for sending Zipkin spans to a Zipkin server. This is similar to a Zipkin SpanCollector and you can easily create
an adapter that wraps a native Zipkin Brave SpanCollector with this interface
if you prefer the features, flexibility, and numerous transport options provided by the native Zipkin SpanCollectors over the
no-dependencies HTTP-only default implementation provided by ZipkinSpanSenderDefaultHttpImpl.
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Forces any queued/batched spans to be sent to the Zipkin server as quickly as possible.
|
void |
handleSpan(zipkin.Span span)
"Handles" the given Zipkin span.
|
void handleSpan(zipkin.Span span)
"Handles" the given Zipkin span. In a typical implementation spans are stored in a threadsafe collection for batching until some trigger is hit that causes the span batch to be sent to the Zipkin server (e.g. scheduled job that sends batches every x period of time, or after a batch size threshold is hit, or both).
IMPORTANT NOTE: DO NOT BLOCK IN THIS METHOD'S IMPLEMENTATION. If you send data to the Zipkin server directly based on this method call then it should be split out into a separate thread to do the work. The only thing that should happen on the calling thread is to put the span into a queue for later processing, or spinning off a job on a separate thread.
span - The Zipkin span to handle.void flush()
Forces any queued/batched spans to be sent to the Zipkin server as quickly as possible.
IMPORTANT NOTE: DO NOT BLOCK IN THIS METHOD'S IMPLEMENTATION. This method should spin off a task on a separate thread for executing the push-to-Zipkin-server logic.
flush in interface java.io.Flushable