Package zipkin2.reporter.brave
Class AsyncZipkinSpanHandler
java.lang.Object
brave.handler.SpanHandler
zipkin2.reporter.brave.ZipkinSpanHandler
zipkin2.reporter.brave.AsyncZipkinSpanHandler
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public final class AsyncZipkinSpanHandler extends ZipkinSpanHandler implements Closeable, Flushable
A
SpanHandler that queues spans on ZipkinSpanHandler.end(brave.propagation.TraceContext, brave.handler.MutableSpan, brave.handler.SpanHandler.Cause) to bundle and send as a
bulk Zipkin JSON V2 message. When the Sender is HTTP, the endpoint is usually "http://zipkinhost:9411/api/v2/spans".
Example:
sender = URLConnectionSender.create("http://localhost:9411/api/v2/spans");
zipkinSpanHandler = AsyncZipkinSpanHandler.create(sender); // don't forget to close!
tracingBuilder.addSpanHandler(zipkinSpanHandler);
- Since:
- 2.14
- See Also:
if you need to use a different format,Tracing.Builder.addSpanHandler(SpanHandler)
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAsyncZipkinSpanHandler.Builder -
Field Summary
-
Method Summary
Modifier and Type Method Description voidclose()Implementations that throw exceptions on close have bugs.static AsyncZipkinSpanHandlercreate(Sender sender)voidflush()static AsyncZipkinSpanHandler.BuildernewBuilder(Sender sender)AsyncZipkinSpanHandler.BuildertoBuilder()Allows this instance to be reconfigured, for exampleZipkinSpanHandler.Builder.alwaysReportSpans(boolean).Methods inherited from class zipkin2.reporter.brave.ZipkinSpanHandler
create, end, equals, hashCode, newBuilder, toString
-
Method Details
-
create
- Since:
- 2.14
-
newBuilder
- Since:
- 2.14
-
toBuilder
Description copied from class:ZipkinSpanHandlerAllows this instance to be reconfigured, for exampleZipkinSpanHandler.Builder.alwaysReportSpans(boolean).Note: Call
ZipkinSpanHandler.close()if you no longer need this instance, as otherwise it can leak resources.- Overrides:
toBuilderin classZipkinSpanHandler
-
flush
public void flush() -
close
public void close()Description copied from class:ZipkinSpanHandlerImplementations that throw exceptions on close have bugs. This may result in log warnings, though.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classZipkinSpanHandler
-