Class MongoTracingObservationHandler
java.lang.Object
org.springframework.data.mongodb.observability.MongoTracingObservationHandler
- All Implemented Interfaces:
io.micrometer.observation.ObservationHandler<MongoHandlerContext>
,io.micrometer.tracing.handler.TracingObservationHandler<MongoHandlerContext>
public class MongoTracingObservationHandler
extends Object
implements io.micrometer.tracing.handler.TracingObservationHandler<MongoHandlerContext>
A
TracingObservationHandler
that handles MongoHandlerContext
. It configures a span specific to Mongo
operations.- Since:
- 4.0.0
- Author:
- Marcin Grzejszczak, Greg Turnquist
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.observation.ObservationHandler
io.micrometer.observation.ObservationHandler.AllMatchingCompositeObservationHandler, io.micrometer.observation.ObservationHandler.CompositeObservationHandler, io.micrometer.observation.ObservationHandler.FirstMatchingCompositeObservationHandler
Nested classes/interfaces inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
io.micrometer.tracing.handler.TracingObservationHandler.TracingContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.micrometer.tracing.Tracer
boolean
Should remote ip and port be set on the span.void
onStart
(MongoHandlerContext context) void
onStop
(MongoHandlerContext context) void
setSetRemoteIpAndPortEnabled
(boolean setRemoteIpAndPortEnabled) boolean
supportsContext
(io.micrometer.observation.Observation.Context context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micrometer.tracing.handler.TracingObservationHandler
getRequiredSpan, getSpanName, getTracingContext, onError, onScopeClosed, onScopeOpened, tagSpan
-
Constructor Details
-
MongoTracingObservationHandler
public MongoTracingObservationHandler(io.micrometer.tracing.Tracer tracer)
-
-
Method Details
-
getTracer
public io.micrometer.tracing.Tracer getTracer()- Specified by:
getTracer
in interfaceio.micrometer.tracing.handler.TracingObservationHandler<MongoHandlerContext>
-
onStart
- Specified by:
onStart
in interfaceio.micrometer.observation.ObservationHandler<MongoHandlerContext>
-
onStop
- Specified by:
onStop
in interfaceio.micrometer.observation.ObservationHandler<MongoHandlerContext>
-
supportsContext
public boolean supportsContext(io.micrometer.observation.Observation.Context context) - Specified by:
supportsContext
in interfaceio.micrometer.observation.ObservationHandler<MongoHandlerContext>
- Specified by:
supportsContext
in interfaceio.micrometer.tracing.handler.TracingObservationHandler<MongoHandlerContext>
-
isSetRemoteIpAndPortEnabled
public boolean isSetRemoteIpAndPortEnabled()Should remote ip and port be set on the span.- Returns:
true
when the remote ip and port should be set
-
setSetRemoteIpAndPortEnabled
public void setSetRemoteIpAndPortEnabled(boolean setRemoteIpAndPortEnabled)
-