Class ErrorLoggingObservationHandler

java.lang.Object
org.springframework.ai.model.observation.ErrorLoggingObservationHandler
All Implemented Interfaces:
io.micrometer.observation.ObservationHandler

public class ErrorLoggingObservationHandler extends Object implements io.micrometer.observation.ObservationHandler
An ObservationHandler that logs errors using a Tracer.
Since:
1.0.0
Author:
Christian Tzolov
  • 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
    ErrorLoggingObservationHandler(io.micrometer.tracing.Tracer tracer, List<Class<? extends io.micrometer.observation.Observation.Context>> supportedContextTypes)
     
    ErrorLoggingObservationHandler(io.micrometer.tracing.Tracer tracer, List<Class<? extends io.micrometer.observation.Observation.Context>> supportedContextTypes, Consumer<io.micrometer.observation.Observation.Context> errorConsumer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onError(io.micrometer.observation.Observation.Context 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

    onEvent, onScopeClosed, onScopeOpened, onScopeReset, onStart, onStop
  • Constructor Details

    • ErrorLoggingObservationHandler

      public ErrorLoggingObservationHandler(io.micrometer.tracing.Tracer tracer, List<Class<? extends io.micrometer.observation.Observation.Context>> supportedContextTypes)
    • ErrorLoggingObservationHandler

      public ErrorLoggingObservationHandler(io.micrometer.tracing.Tracer tracer, List<Class<? extends io.micrometer.observation.Observation.Context>> supportedContextTypes, Consumer<io.micrometer.observation.Observation.Context> errorConsumer)
  • Method Details

    • supportsContext

      public boolean supportsContext(io.micrometer.observation.Observation.Context context)
      Specified by:
      supportsContext in interface io.micrometer.observation.ObservationHandler
    • onError

      public void onError(io.micrometer.observation.Observation.Context context)
      Specified by:
      onError in interface io.micrometer.observation.ObservationHandler