Package io.micrometer.observation
Class ObservationHandler.FirstMatchingCompositeObservationHandler
java.lang.Object
io.micrometer.observation.ObservationHandler.FirstMatchingCompositeObservationHandler
- All Implemented Interfaces:
ObservationHandler<Observation.Context>,ObservationHandler.CompositeObservationHandler
- Enclosing interface:
ObservationHandler<T extends Observation.Context>
public static class ObservationHandler.FirstMatchingCompositeObservationHandler
extends Object
implements ObservationHandler.CompositeObservationHandler
Handler picking the first matching handler from the list.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micrometer.observation.ObservationHandler
ObservationHandler.AllMatchingCompositeObservationHandler, ObservationHandler.CompositeObservationHandler, ObservationHandler.FirstMatchingCompositeObservationHandler -
Constructor Summary
ConstructorsConstructorDescriptionFirstMatchingCompositeObservationHandler(ObservationHandler<? extends Observation.Context>... handlers) Creates a new instance ofFirstMatchingCompositeObservationHandler.FirstMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation.Context>> handlers) Creates a new instance ofFirstMatchingCompositeObservationHandler. -
Method Summary
Modifier and TypeMethodDescriptionReturns the registered handlers.voidonError(Observation.Context context) Reacts to an error during anObservation.voidonEvent(Observation.Event event, Observation.Context context) Reacts to arbitraryObservation.Event.voidonScopeClosed(Observation.Context context) Reacts to closing of anObservation.Scope.voidonScopeOpened(Observation.Context context) Reacts to opening of anObservation.Scope.voidonScopeReset(Observation.Context context) Reacts to resetting of scopes.voidonStart(Observation.Context context) Reacts to starting of anObservation.voidonStop(Observation.Context context) Reacts to stopping of anObservation.booleansupportsContext(Observation.Context context) Tells the registry whether this handler should be applied for a givenObservation.Context.
-
Constructor Details
-
FirstMatchingCompositeObservationHandler
@SafeVarargs public FirstMatchingCompositeObservationHandler(ObservationHandler<? extends Observation.Context>... handlers) Creates a new instance ofFirstMatchingCompositeObservationHandler.- Parameters:
handlers- the handlers that are registered under the composite
-
FirstMatchingCompositeObservationHandler
public FirstMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation.Context>> handlers) Creates a new instance ofFirstMatchingCompositeObservationHandler.- Parameters:
handlers- the handlers that are registered under the composite
-
-
Method Details
-
getHandlers
Description copied from interface:ObservationHandler.CompositeObservationHandlerReturns the registered handlers.- Specified by:
getHandlersin interfaceObservationHandler.CompositeObservationHandler- Returns:
- registered handlers
-
onStart
Description copied from interface:ObservationHandlerReacts to starting of anObservation.- Specified by:
onStartin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
onError
Description copied from interface:ObservationHandlerReacts to an error during anObservation.- Specified by:
onErrorin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
onEvent
Description copied from interface:ObservationHandlerReacts to arbitraryObservation.Event.- Specified by:
onEventin interfaceObservationHandler<Observation.Context>- Parameters:
event- theObservation.Eventthat was signaledcontext- anObservation.Context
-
onScopeOpened
Description copied from interface:ObservationHandlerReacts to opening of anObservation.Scope.- Specified by:
onScopeOpenedin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
onScopeClosed
Description copied from interface:ObservationHandlerReacts to closing of anObservation.Scope.- Specified by:
onScopeClosedin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
onScopeReset
Description copied from interface:ObservationHandlerReacts to resetting of scopes. If your handler uses aThreadLocalvalue, this method should clear thatThreadLocalor any other scoped variable.- Specified by:
onScopeResetin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
onStop
Description copied from interface:ObservationHandlerReacts to stopping of anObservation.- Specified by:
onStopin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context
-
supportsContext
Description copied from interface:ObservationHandlerTells the registry whether this handler should be applied for a givenObservation.Context.- Specified by:
supportsContextin interfaceObservationHandler<Observation.Context>- Parameters:
context- anObservation.Context- Returns:
truewhen this handler should be used
-