Package io.vertx.core.spi.tracing
Interface VertxTracer<I,O>
-
- All Known Implementing Classes:
OpenTracingTracer,ZipkinTracer
public interface VertxTracer<I,O>The tracer SPI used by Vert.x components to report activities.- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static VertxTracerNOOPNoop tracer.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidclose()Close the tracer.default <R> IreceiveRequest(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.default <R> voidreceiveResponse(Context context, R response, O payload, Throwable failure, TagExtractor<R> tagExtractor)Signal a response has been received.default <R> OsendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, BiConsumer<String,String> headers, TagExtractor<R> tagExtractor)Signal a request is sent.default <R> voidsendResponse(Context context, R response, I payload, Throwable failure, TagExtractor<R> tagExtractor)Signal the response is sent.
-
-
-
Field Detail
-
NOOP
static final VertxTracer NOOP
Noop tracer.
-
-
Method Detail
-
receiveRequest
default <R> I receiveRequest(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.- 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
default <R> void sendResponse(Context context, R response, I payload, Throwable failure, TagExtractor<R> tagExtractor)
Signal the response is sent.- Parameters:
context- the context data attached to the requestresponse- the response sentpayload- the payload returned byreceiveRequest(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
default <R> O sendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, BiConsumer<String,String> headers, TagExtractor<R> tagExtractor)
Signal a request is sent.When the method returns
null, no propagation happens and the client shall not callreceiveResponse(io.vertx.core.Context, R, O, java.lang.Throwable, io.vertx.core.spi.tracing.TagExtractor<R>).- 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
default <R> void receiveResponse(Context context, R response, O payload, Throwable failure, TagExtractor<R> tagExtractor)
Signal a response has been received.- Parameters:
context- the context data attached to the requestresponse- the response sentpayload- the payload returned bysendRequest(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
default void close()
Close the tracer.
-
-