Package io.lettuce.core.tracing
Class BraveTracing
- java.lang.Object
-
- io.lettuce.core.tracing.BraveTracing
-
- All Implemented Interfaces:
Tracing
public class BraveTracing extends Object implements Tracing
Tracing
integration with OpenZipkin's BraveTracer
. This implementation creates BraveSpan
s that are optionally associated with aTraceContext
.
Redis commands can use a parent trace context to create aTraceContext
PropagationTracer.Span
to trace the actual command. A parentSpan
is picked up for imperative (synchronous/asynchronous) API usage fromTracing.currentTracer()
. The context is not propagated across asynchronous call chains resulting fromCompletionStage
chaining.Reactive API usage leverages Reactor's
Context
so that subscribers can register one of the following objects (using theirClass
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 class
BraveTracing.BraveEndpoint
Tracing.Endpoint
implementation for Zipkin'sEndpoint
.static class
BraveTracing.BraveTraceContext
TraceContext
implementation for Brave'sTraceContext
.static class
BraveTracing.Builder
Builder forBraveTracing
.-
Nested classes/interfaces inherited from interface io.lettuce.core.tracing.Tracing
Tracing.Endpoint
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BraveTracing.Builder
builder()
Create a newBraveTracing.Builder
to buildBraveTracing
.static BraveTracing
create(brave.Tracing tracing)
Create a newBraveTracing
instance.Tracing.Endpoint
createEndpoint(SocketAddress socketAddress)
Create anTracing.Endpoint
givenSocketAddress
.TracerProvider
getTracerProvider()
boolean
includeCommandArgsInSpanTags()
Returnstrue
if tags forTracer.Span
s should include the command arguments.TraceContextProvider
initialTraceContextProvider()
boolean
isEnabled()
Returnstrue
if tracing is enabled.
-
-
-
Method Detail
-
create
public static BraveTracing create(brave.Tracing tracing)
Create a newBraveTracing
instance.- Parameters:
tracing
- must not benull
.- Returns:
- the
BraveTracing
.
-
builder
public static BraveTracing.Builder builder()
Create a newBraveTracing.Builder
to buildBraveTracing
.- Returns:
- a new instance of
BraveTracing.Builder
. - Since:
- 5.2
-
isEnabled
public boolean isEnabled()
Description copied from interface:Tracing
Returnstrue
if tracing is enabled.
-
includeCommandArgsInSpanTags
public boolean includeCommandArgsInSpanTags()
Description copied from interface:Tracing
Returnstrue
if tags forTracer.Span
s should include the command arguments.- Specified by:
includeCommandArgsInSpanTags
in interfaceTracing
- Returns:
true
if tags forTracer.Span
s should include the command arguments.
-
getTracerProvider
public TracerProvider getTracerProvider()
- Specified by:
getTracerProvider
in interfaceTracing
- Returns:
- the
TracerProvider
.
-
initialTraceContextProvider
public TraceContextProvider initialTraceContextProvider()
- Specified by:
initialTraceContextProvider
in interfaceTracing
- Returns:
- the
TraceContextProvider
supplying the initialTraceContext
(i.e. if there is no active span).
-
createEndpoint
public Tracing.Endpoint createEndpoint(SocketAddress socketAddress)
Description copied from interface:Tracing
Create anTracing.Endpoint
givenSocketAddress
.- Specified by:
createEndpoint
in interfaceTracing
- Parameters:
socketAddress
- the remote address.- Returns:
- the
Tracing.Endpoint
forSocketAddress
.
-
-