public class ZipkinTracer extends Object implements VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE_CONTEXT |
static String |
ACTIVE_REQUEST |
static String |
ACTIVE_SPAN |
NOOP
Constructor and Description |
---|
ZipkinTracer(boolean closeTracer,
brave.http.HttpTracing httpTracing) |
ZipkinTracer(boolean closeTracer,
brave.Tracing tracing) |
Modifier and Type | Method and Description |
---|---|
static brave.propagation.TraceContext |
activeContext() |
static brave.Span |
activeSpan() |
void |
close()
Close the tracer.
|
brave.Tracing |
getTracing() |
<R> brave.Span |
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.
|
<R> void |
receiveResponse(Context context,
R response,
java.util.function.BiConsumer<Object,Throwable> payload,
Throwable failure,
TagExtractor<R> tagExtractor)
Signal a response has been received.
|
<R> java.util.function.BiConsumer<Object,Throwable> |
sendRequest(Context context,
SpanKind kind,
TracingPolicy policy,
R request,
String operation,
java.util.function.BiConsumer<String,String> headers,
TagExtractor<R> tagExtractor)
Signal a request is sent.
|
<R> void |
sendResponse(Context context,
R response,
brave.Span span,
Throwable failure,
TagExtractor<R> tagExtractor)
Signal the response is sent.
|
public static final String ACTIVE_SPAN
public static final String ACTIVE_CONTEXT
public static final String ACTIVE_REQUEST
public ZipkinTracer(boolean closeTracer, brave.Tracing tracing)
public ZipkinTracer(boolean closeTracer, brave.http.HttpTracing httpTracing)
public static brave.Span activeSpan()
Span
otherwise null
public static brave.propagation.TraceContext activeContext()
TraceContext
otherwise null
public brave.Tracing getTracing()
public <R> brave.Span receiveRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, Iterable<Map.Entry<String,String>> headers, TagExtractor<R> tagExtractor)
VertxTracer
receiveRequest
in interface VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
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 extractorpublic <R> void sendResponse(Context context, R response, brave.Span span, Throwable failure, TagExtractor<R> tagExtractor)
VertxTracer
sendResponse
in interface VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
context
- the context data attached to the requestresponse
- the response sentspan
- the payload returned by VertxTracer.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 not null
tagExtractor
- the response tag extractorpublic <R> java.util.function.BiConsumer<Object,Throwable> sendRequest(Context context, SpanKind kind, TracingPolicy policy, R request, String operation, java.util.function.BiConsumer<String,String> headers, TagExtractor<R> tagExtractor)
VertxTracer
When the method returns null
, no propagation happens and the client
shall not call VertxTracer.receiveResponse(io.vertx.core.Context, R, O, java.lang.Throwable, io.vertx.core.spi.tracing.TagExtractor<R>)
.
sendRequest
in interface VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
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 extractorpublic <R> void receiveResponse(Context context, R response, java.util.function.BiConsumer<Object,Throwable> payload, Throwable failure, TagExtractor<R> tagExtractor)
VertxTracer
receiveResponse
in interface VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
context
- the context data attached to the requestresponse
- the response sentpayload
- the payload returned by VertxTracer.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 not null
tagExtractor
- the response tag extractorpublic void close()
VertxTracer
close
in interface VertxTracer<brave.Span,java.util.function.BiConsumer<Object,Throwable>>
Copyright © 2021 Eclipse. All rights reserved.