Package io.vertx.tracing.opentracing
Class OpenTracingTracer
- java.lang.Object
-
- io.vertx.tracing.opentracing.OpenTracingTracer
-
- All Implemented Interfaces:
VertxTracer<io.opentracing.Span,io.opentracing.Span>
public class OpenTracingTracer extends Object implements VertxTracer<io.opentracing.Span,io.opentracing.Span>
- https://github.com/opentracing/specification/blob/master/semantic_conventions.md - https://github.com/opentracing/specification/blob/master/specification.md
-
-
Field Summary
-
Fields inherited from interface io.vertx.core.spi.tracing.VertxTracer
NOOP
-
-
Constructor Summary
Constructors Constructor Description OpenTracingTracer(boolean closeTracer, io.opentracing.Tracer tracer)Instantiate a OpenTracing tracer using the specifiedtracer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the tracer.<R> io.opentracing.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, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)Signal a response has been received.<R> io.opentracing.SpansendRequest(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, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)Signal the response is sent.
-
-
-
Method Detail
-
receiveRequest
public <R> io.opentracing.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<io.opentracing.Span,io.opentracing.Span>- 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, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)
Description copied from interface:VertxTracerSignal the response is sent.- Specified by:
sendResponsein interfaceVertxTracer<io.opentracing.Span,io.opentracing.Span>- Parameters:
context- the context data attached to the requestresponse- the response sentspan- the payload returned byVertxTracer.receiveRequest(io.vertx.core.Context, io.vertx.core.spi.tracing.SpanKind, io.vertx.core.tracing.TracingPolicy, R, java.lang.String, java.lang.Iterable<java.util.Map.Entry<java.lang.String, java.lang.String>>, io.vertx.core.spi.tracing.TagExtractor<R>)failure- the failure when notnulltagExtractor- the response tag extractor
-
sendRequest
public <R> io.opentracing.Span 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(io.vertx.core.Context, R, O, java.lang.Throwable, io.vertx.core.spi.tracing.TagExtractor<R>).- Specified by:
sendRequestin interfaceVertxTracer<io.opentracing.Span,io.opentracing.Span>- 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, io.opentracing.Span span, Throwable failure, TagExtractor<R> tagExtractor)
Description copied from interface:VertxTracerSignal a response has been received.- Specified by:
receiveResponsein interfaceVertxTracer<io.opentracing.Span,io.opentracing.Span>- Parameters:
context- the context data attached to the requestresponse- the response sentspan- the payload returned byVertxTracer.sendRequest(io.vertx.core.Context, io.vertx.core.spi.tracing.SpanKind, io.vertx.core.tracing.TracingPolicy, R, java.lang.String, java.util.function.BiConsumer<java.lang.String, java.lang.String>, io.vertx.core.spi.tracing.TagExtractor<R>)failure- the failure when notnulltagExtractor- the response tag extractor
-
close
public void close()
Description copied from interface:VertxTracerClose the tracer.- Specified by:
closein interfaceVertxTracer<io.opentracing.Span,io.opentracing.Span>
-
-