Package io.lettuce.core.tracing
Class MicrometerTracing
- java.lang.Object
-
- io.lettuce.core.tracing.MicrometerTracing
-
- All Implemented Interfaces:
Tracing
public class MicrometerTracing extends Object implements Tracing
Tracing
adapter using Micrometer'sObservation
. This adapter integrates with Micrometer to propagate observations into timers, distributed traces and any other registered handlers. Observations include a set of tags capturing Redis runtime information.Capturing full statements
This adapter can capture full statements when enablingincludeCommandArgsInSpanTags
. You should carefully consider the impact of this setting as all command arguments will be captured in traces including these that may contain sensitive details.- Since:
- 6.3
- Author:
- Mark Paluch
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.lettuce.core.tracing.Tracing
Tracing.Endpoint
-
-
Constructor Summary
Constructors Constructor Description MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName)
Create a newMicrometerTracing
instance.MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName, boolean includeCommandArgsInSpanTags)
Create a newMicrometerTracing
instance.MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName, LettuceObservationConvention convention)
Create a newMicrometerTracing
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Constructor Detail
-
MicrometerTracing
public MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName)
Create a newMicrometerTracing
instance.- Parameters:
observationRegistry
- must not be null.serviceName
- service name to be used.
-
MicrometerTracing
public MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName, boolean includeCommandArgsInSpanTags)
Create a newMicrometerTracing
instance.- Parameters:
observationRegistry
- must not be null.serviceName
- service name to be used.includeCommandArgsInSpanTags
- whether to attach the full command into the trace. Use this flag with caution as sensitive arguments will be captured in the observation spans and metric tags.
-
MicrometerTracing
public MicrometerTracing(io.micrometer.observation.ObservationRegistry observationRegistry, String serviceName, LettuceObservationConvention convention)
Create a newMicrometerTracing
instance.- Parameters:
observationRegistry
- must not be null.serviceName
- service name to be used.convention
- the observation convention to use
-
-
Method Detail
-
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).
-
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.
-
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
.
-
-