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,
VertxSender sender) |
ZipkinTracer(boolean closeTracer,
brave.Tracing tracing,
VertxSender sender) |
Modifier and Type | Method and Description |
---|---|
static brave.propagation.TraceContext |
activeContext() |
static brave.Span |
activeSpan() |
static void |
clearContext()
Remove any active context.
|
static void |
clearSpan()
Remove any active span.
|
void |
close()
Close the tracer.
|
static String |
exportTraceId()
Export active traceId otherwise
null . |
brave.Tracing |
getTracing() |
static void |
importTraceId(String traceId)
Import traceId.
|
<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.
|
VertxSender |
sender() |
<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.
|
static void |
setSpan(brave.Span span)
Set active
Span . |
static void |
setTraceContext(brave.propagation.TraceContext context)
Set active
TraceContext . |
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, VertxSender sender)
public ZipkinTracer(boolean closeTracer, brave.http.HttpTracing httpTracing, VertxSender sender)
public VertxSender sender()
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>>
public static void clearContext()
public static void clearSpan()
public static void importTraceId(String traceId)
public static String exportTraceId()
null
.public static void setTraceContext(brave.propagation.TraceContext context)
TraceContext
.public static void setSpan(brave.Span span)
Span
.Copyright © 2023 Eclipse. All rights reserved.