Class ZipkinTracer
java.lang.Object
io.vertx.tracing.zipkin.ZipkinTracer
- All Implemented Interfaces:
VertxTracer<brave.Span, BiConsumer<Object, Throwable>>
public class ZipkinTracer
extends Object
implements VertxTracer<brave.Span, BiConsumer<Object, Throwable>>
-
Field Summary
Fields inherited from interface VertxTracer
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionZipkinTracer(boolean closeTracer, brave.http.HttpTracing httpTracing, VertxSender sender) ZipkinTracer(boolean closeTracer, brave.Tracing tracing, VertxSender sender) -
Method Summary
Modifier and TypeMethodDescriptionstatic brave.propagation.TraceContextstatic brave.Spanstatic voidRemove any active context.static voidRemove any active span.voidclose()Close the tracer.static StringExport active traceId otherwisenull.brave.Tracingstatic voidimportTraceId(String traceId) Import traceId.<R> brave.SpanreceiveRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, Iterable<Map.Entry<String, String>> headers, TagExtractor<R> tagExtractor) Signal a request has been received and will be processed.<R> voidreceiveResponse(Context context, R response, BiConsumer<Object, Throwable> payload, Throwable failure, TagExtractor<R> tagExtractor) Signal a response has been received.sender()<R> BiConsumer<Object, Throwable> sendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, BiConsumer<String, String> headers, TagExtractor<R> tagExtractor) Signal a request is sent.<R> voidsendResponse(Context context, R response, brave.Span span, Throwable failure, TagExtractor<R> tagExtractor) Signal the response is sent.static voidsetSpan(brave.Span span) Set activeSpan.static voidsetTraceContext(brave.propagation.TraceContext context) Set activeTraceContext.
-
Constructor Details
-
ZipkinTracer
-
ZipkinTracer
-
-
Method Details
-
sender
-
activeSpan
public static brave.Span activeSpan()- Returns:
- the current active
Spanotherwisenull
-
activeContext
public static brave.propagation.TraceContext activeContext()- Returns:
- the current active
TraceContextotherwisenull
-
getTracing
public brave.Tracing getTracing() -
receiveRequest
public <R> brave.Span receiveRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, Iterable<Map.Entry<String, String>> headers, TagExtractor<R> tagExtractor) Description copied from interface:VertxTracerSignal a request has been received and will be processed.- Specified by:
receiveRequestin interfaceVertxTracer<brave.Span, BiConsumer<Object, Throwable>>- Parameters:
context- the context data attached to the requestkind- the span kindpolicy- the policy to applyrequest- the request objectoperation- the request operationheaders- a read-only view of the request headerstagExtractor- the request tag extractor- Returns:
- the request trace
-
sendResponse
public <R> void sendResponse(Context context, R response, brave.Span span, Throwable failure, TagExtractor<R> tagExtractor) Description copied from interface:VertxTracerSignal the response is sent.- Specified by:
sendResponsein interfaceVertxTracer<brave.Span, BiConsumer<Object, Throwable>>- Parameters:
context- the context data attached to the requestresponse- the response sentspan- the payload returned byVertxTracer.receiveRequest(Context, SpanKind, TracingPolicy, R, String, Iterable, TagExtractor)failure- the failure when notnulltagExtractor- the response tag extractor
-
sendRequest
public <R> BiConsumer<Object, Throwable> sendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, BiConsumer<String, String> headers, TagExtractor<R> tagExtractor) Description copied from interface:VertxTracerSignal a request is sent.When the method returns
null, no propagation happens and the client shall not callVertxTracer.receiveResponse(Context, R, O, Throwable, TagExtractor).- Specified by:
sendRequestin interfaceVertxTracer<brave.Span, BiConsumer<Object, Throwable>>- Parameters:
context- the context data attached to the requestkind- the span kindpolicy- the policy to applyrequest- the request objectoperation- the request operationheaders- a write only-view of the request headerstagExtractor- the request tag extractor- Returns:
- the request trace
-
receiveResponse
public <R> void receiveResponse(Context context, R response, BiConsumer<Object, Throwable> payload, Throwable failure, TagExtractor<R> tagExtractor) Description copied from interface:VertxTracerSignal a response has been received.- Specified by:
receiveResponsein interfaceVertxTracer<brave.Span, BiConsumer<Object, Throwable>>- Parameters:
context- the context data attached to the requestresponse- the response sentpayload- the payload returned byVertxTracer.sendRequest(Context, SpanKind, TracingPolicy, R, String, BiConsumer, TagExtractor)failure- the failure when notnulltagExtractor- the response tag extractor
-
close
public void close()Description copied from interface:VertxTracerClose the tracer.- Specified by:
closein interfaceVertxTracer<brave.Span, BiConsumer<Object, Throwable>>
-
clearContext
public static void clearContext()Remove any active context. -
clearSpan
public static void clearSpan()Remove any active span. -
importTraceId
Import traceId. -
exportTraceId
Export active traceId otherwisenull. -
setTraceContext
public static void setTraceContext(brave.propagation.TraceContext context) Set activeTraceContext. -
setSpan
public static void setSpan(brave.Span span) Set activeSpan.
-