Class TracingAwareMeterObservationHandler<T extends io.micrometer.observation.Observation.Context>

java.lang.Object
io.micrometer.tracing.handler.TracingAwareMeterObservationHandler<T>
Type Parameters:
T - type of handler context
All Implemented Interfaces:
io.micrometer.core.instrument.observation.MeterObservationHandler<T>, io.micrometer.observation.ObservationHandler<T>

@NonNullApi public class TracingAwareMeterObservationHandler<T extends io.micrometer.observation.Observation.Context> extends Object implements io.micrometer.core.instrument.observation.MeterObservationHandler<T>
A MeterObservationHandler that can wrap another one and makes the tracing data available for it. This handler can be used in cases where the MeterRegistry or the MeterObservationHandler itself needs access to the tracing data (e.g.: exemplars).
Since:
1.0.0
  • 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
  • Constructor Summary

    Constructors
    Constructor
    Description
    TracingAwareMeterObservationHandler(io.micrometer.core.instrument.observation.MeterObservationHandler<T> delegate, Tracer tracer)
    Creates a new instance of TracingAwareMeterObservationHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onError(T context)
     
    void
    onEvent(io.micrometer.observation.Observation.Event event, T context)
     
    void
    onScopeClosed(T context)
     
    void
    onScopeOpened(T context)
     
    void
    onStart(T context)
     
    void
    onStop(T context)
     
    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.observation.ObservationHandler

    onScopeReset
  • Constructor Details

    • TracingAwareMeterObservationHandler

      public TracingAwareMeterObservationHandler(io.micrometer.core.instrument.observation.MeterObservationHandler<T> delegate, Tracer tracer)
      Creates a new instance of TracingAwareMeterObservationHandler.
      Parameters:
      delegate - a MeterObservationHandler delegate
      tracer - tracer
  • Method Details

    • onStart

      public void onStart(T context)
      Specified by:
      onStart in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onError

      public void onError(T context)
      Specified by:
      onError in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onEvent

      public void onEvent(io.micrometer.observation.Observation.Event event, T context)
      Specified by:
      onEvent in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onScopeOpened

      public void onScopeOpened(T context)
      Specified by:
      onScopeOpened in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onScopeClosed

      public void onScopeClosed(T context)
      Specified by:
      onScopeClosed in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>
    • onStop

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

      public boolean supportsContext(io.micrometer.observation.Observation.Context context)
      Specified by:
      supportsContext in interface io.micrometer.core.instrument.observation.MeterObservationHandler<T extends io.micrometer.observation.Observation.Context>
      Specified by:
      supportsContext in interface io.micrometer.observation.ObservationHandler<T extends io.micrometer.observation.Observation.Context>