Class DefaultMeterObservationHandler

java.lang.Object
io.micrometer.core.instrument.observation.DefaultMeterObservationHandler
All Implemented Interfaces:
MeterObservationHandler<io.micrometer.observation.Observation.Context>, io.micrometer.observation.ObservationHandler<io.micrometer.observation.Observation.Context>

public class DefaultMeterObservationHandler extends Object implements MeterObservationHandler<io.micrometer.observation.Observation.Context>
Handler for Timer.Sample and Counter. WARNING: Since the LongTaskTimer needs to be created in the onStart method, it can only contain tags that are available by that time. This means that if you add a lowCardinalityKeyValue after calling start on the Observation, that KeyValue will not be translated as a Tag on the LongTaskTimer. Likewise, since the KeyValuesProvider is evaluated in the stop method of the Observation (after start), those KeyValue instances will not be used for the LongTaskTimer.
Since:
1.10.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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEvent(io.micrometer.observation.Observation.Event event, io.micrometer.observation.Observation.Context context)
     
    void
    onStart(io.micrometer.observation.Observation.Context context)
     
    void
    onStop(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.core.instrument.observation.MeterObservationHandler

    supportsContext

    Methods inherited from interface io.micrometer.observation.ObservationHandler

    onError, onScopeClosed, onScopeOpened, onScopeReset
  • Constructor Details

    • DefaultMeterObservationHandler

      public DefaultMeterObservationHandler(MeterRegistry meterRegistry)
  • Method Details

    • onStart

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

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

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