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

    Constructors
    Constructor
    Description
    MongoTracingObservationHandler(io.micrometer.tracing.Tracer tracer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micrometer.tracing.Tracer
     
    boolean
    Should remote ip and port be set on the span.
    void
     
    void
     
    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

    getParentSpan, getRequiredSpan, getSpanName, getTracingContext, onError, onEvent, 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 interface io.micrometer.tracing.handler.TracingObservationHandler<MongoHandlerContext>
    • onStart

      public void onStart(MongoHandlerContext context)
      Specified by:
      onStart in interface io.micrometer.observation.ObservationHandler<MongoHandlerContext>
    • onStop

      public void onStop(MongoHandlerContext context)
      Specified by:
      onStop in interface io.micrometer.observation.ObservationHandler<MongoHandlerContext>
    • supportsContext

      public boolean supportsContext(io.micrometer.observation.Observation.Context context)
      Specified by:
      supportsContext in interface io.micrometer.observation.ObservationHandler<MongoHandlerContext>
      Specified by:
      supportsContext in interface io.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)