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
ASpanHandlerthat queues spans onZipkinSpanHandler.end(brave.propagation.TraceContext, brave.handler.MutableSpan, brave.handler.SpanHandler.Cause)to bundle and send as a bulk Zipkin JSON V2 message. When theSenderis 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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
create
public static AsyncZipkinSpanHandler create(Sender sender)
- Since:
- 2.14
-
newBuilder
public static AsyncZipkinSpanHandler.Builder newBuilder(Sender sender)
- Since:
- 2.14
-
toBuilder
public AsyncZipkinSpanHandler.Builder 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
-
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
-
-