java.lang.Object
io.lettuce.core.tracing.BraveTracing
- All Implemented Interfaces:
Tracing
public class BraveTracing extends Object implements Tracing
Tracing integration with OpenZipkin's Brave Tracer. This implementation creates Brave
Spans that are optionally associated with a TraceContext.
TraceContext Propagation
Redis commands can use a parent trace context to create a
Tracer.Span to trace the actual command. A parent Span is picked up for
imperative (synchronous/asynchronous) API usage from Tracing.currentTracer(). The context is not propagated
across asynchronous call chains resulting from CompletionStage chaining.
Reactive API usage leverages Reactor's Context so that subscribers can register one of the
following objects (using their Class as context key):
- A
TraceContextProvider - A Brave
Span: Commands extract theTraceContext - A Brave
TraceContext
Span.- Since:
- 5.1
- Author:
- Mark Paluch, Daniel Albuquerque
- See Also:
Tracer,Tracing.currentTracer(),BraveTracing.BraveTraceContextProvider,builder()
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBraveTracing.BraveEndpointTracing.Endpointimplementation for Zipkin'sEndpoint.static classBraveTracing.BraveTraceContextTraceContextimplementation for Brave'sTraceContext.static classBraveTracing.BuilderBuilder forBraveTracing.Nested classes/interfaces inherited from interface io.lettuce.core.tracing.Tracing
Tracing.Endpoint -
Method Summary
Modifier and Type Method Description static BraveTracing.Builderbuilder()Create a newBraveTracing.Builderto buildBraveTracing.static BraveTracingcreate(brave.Tracing tracing)Create a newBraveTracinginstance.Tracing.EndpointcreateEndpoint(SocketAddress socketAddress)Create anTracing.EndpointgivenSocketAddress.TracerProvidergetTracerProvider()booleanincludeCommandArgsInSpanTags()Returnstrueif tags forTracer.Spans should include the command arguments.TraceContextProviderinitialTraceContextProvider()booleanisEnabled()Returnstrueif tracing is enabled.
-
Method Details
-
create
Create a newBraveTracinginstance.- Parameters:
tracing- must not benull.- Returns:
- the
BraveTracing.
-
builder
Create a newBraveTracing.Builderto buildBraveTracing.- Returns:
- a new instance of
BraveTracing.Builder. - Since:
- 5.2
-
isEnabled
public boolean isEnabled()Description copied from interface:TracingReturnstrueif tracing is enabled. -
includeCommandArgsInSpanTags
public boolean includeCommandArgsInSpanTags()Description copied from interface:TracingReturnstrueif tags forTracer.Spans should include the command arguments.- Specified by:
includeCommandArgsInSpanTagsin interfaceTracing- Returns:
trueif tags forTracer.Spans should include the command arguments.
-
getTracerProvider
- Specified by:
getTracerProviderin interfaceTracing- Returns:
- the
TracerProvider.
-
initialTraceContextProvider
- Specified by:
initialTraceContextProviderin interfaceTracing- Returns:
- the
TraceContextProvidersupplying the initialTraceContext(i.e. if there is no active span).
-
createEndpoint
Description copied from interface:TracingCreate anTracing.EndpointgivenSocketAddress.- Specified by:
createEndpointin interfaceTracing- Parameters:
socketAddress- the remote address.- Returns:
- the
Tracing.EndpointforSocketAddress.
-