Observation. Hooks in to the lifecycle of an observation.
Example of handler implementations can create metrics, spans or logs.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ObservationHandler.AllMatchingCompositeObservationHandler
Handler picking all matching handlers from the list. |
| public static interface | ObservationHandler.CompositeObservationHandler
Handler wrapping other handlers. |
| public static class | ObservationHandler.FirstMatchingCompositeObservationHandler
Handler picking the first matching handler from the list. |
| Modifier and Type | Method and Description |
|---|---|
| public default void | |
| public default void | onEvent(Observation.
the event,Observation. that was signaledReacts to arbitrary |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public boolean | Returns: true when this handler should be usedTells the registry whether this handler should be applied for a given
|
| onError | back to summary |
|---|---|
| public default void onError(T context) Reacts to an error during an
| |
| onEvent | back to summary |
|---|---|
| public default void onEvent(Observation. Reacts to arbitrary
| |
| onScopeClosed | back to summary |
|---|---|
| public default void onScopeClosed(T context) Reacts to closing of an
| |
| onScopeOpened | back to summary |
|---|---|
| public default void onScopeOpened(T context) Reacts to opening of an
| |
| onScopeReset | back to summary |
|---|---|
| public default void onScopeReset(T context) Reacts to resetting of scopes. If your handler uses a
| |
| onStart | back to summary |
|---|---|
| public default void onStart(T context) Reacts to starting of an
| |
| onStop | back to summary |
|---|---|
| public default void onStop(T context) Reacts to stopping of an
| |
| supportsContext | back to summary |
|---|---|
| public boolean supportsContext(Observation. Tells the registry whether this handler should be applied for a given
| |
| Modifier and Type | Field and Description |
|---|---|
| private final List |
| Access | Constructor and Description |
|---|---|
| public | AllMatchingCompositeObservationHandler(ObservationHandler<? extends Observation.
the handlers that are registered under the composite handlers)Creates a new instance of |
| public | AllMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation.
the handlers that are registered under the composite handlers)Creates a new instance of |
| handlers | back to summary |
|---|---|
| private final List<ObservationHandler<Observation. | |
| AllMatchingCompositeObservationHandler | back to summary |
|---|---|
| public AllMatchingCompositeObservationHandler(ObservationHandler<? extends Observation. Creates a new instance of
| |
| AllMatchingCompositeObservationHandler | back to summary |
|---|---|
| public AllMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation. Creates a new instance of
| |
| getHandlers | back to summary |
|---|---|
| public List Implements io. Doc from io. Returns the registered handlers.
| |
| onError | back to summary |
|---|---|
| public void onError(Observation. Overrides default io. Doc from io. Reacts to an error during an
| |
| onEvent | back to summary |
|---|---|
| public void onEvent(Observation. Overrides default io. Doc from io. Reacts to arbitrary
| |
| onScopeClosed | back to summary |
|---|---|
| public void onScopeClosed(Observation. Overrides default io. Doc from io. Reacts to closing of an
| |
| onScopeOpened | back to summary |
|---|---|
| public void onScopeOpened(Observation. Overrides default io. Doc from io. Reacts to opening of an
| |
| onScopeReset | back to summary |
|---|---|
| public void onScopeReset(Observation. Overrides default io. Doc from io. Reacts to resetting of scopes. If your handler uses a
| |
| onStart | back to summary |
|---|---|
| public void onStart(Observation. Overrides default io. Doc from io. Reacts to starting of an
| |
| onStop | back to summary |
|---|---|
| public void onStop(Observation. Overrides default io. Doc from io. Reacts to stopping of an
| |
| supportsContext | back to summary |
|---|---|
| public boolean supportsContext(Observation. Implements io. Doc from io. Tells the registry whether this handler should be applied for a given
| |
| Modifier and Type | Method and Description |
|---|---|
| public List |
| getHandlers | back to summary |
|---|---|
| public List Returns the registered handlers.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final List |
| Access | Constructor and Description |
|---|---|
| public | FirstMatchingCompositeObservationHandler(ObservationHandler<? extends Observation.
the handlers that are registered under the composite handlers)Creates a new instance of |
| public | FirstMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation.
the handlers that are registered under the composite handlers)Creates a new instance of |
| handlers | back to summary |
|---|---|
| private final List<ObservationHandler<Observation. | |
| FirstMatchingCompositeObservationHandler | back to summary |
|---|---|
| public FirstMatchingCompositeObservationHandler(ObservationHandler<? extends Observation. Creates a new instance of
| |
| FirstMatchingCompositeObservationHandler | back to summary |
|---|---|
| public FirstMatchingCompositeObservationHandler(List<? extends ObservationHandler<? extends Observation. Creates a new instance of
| |
| getFirstApplicableHandler | back to summary |
|---|---|
private ObservationHandler
| |
| getHandlers | back to summary |
|---|---|
| public List Implements io. Doc from io. Returns the registered handlers.
| |
| onError | back to summary |
|---|---|
| public void onError(Observation. Overrides default io. Doc from io. Reacts to an error during an
| |
| onEvent | back to summary |
|---|---|
| public void onEvent(Observation. Overrides default io. Doc from io. Reacts to arbitrary
| |
| onScopeClosed | back to summary |
|---|---|
| public void onScopeClosed(Observation. Overrides default io. Doc from io. Reacts to closing of an
| |
| onScopeOpened | back to summary |
|---|---|
| public void onScopeOpened(Observation. Overrides default io. Doc from io. Reacts to opening of an
| |
| onScopeReset | back to summary |
|---|---|
| public void onScopeReset(Observation. Overrides default io. Doc from io. Reacts to resetting of scopes. If your handler uses a
| |
| onStart | back to summary |
|---|---|
| public void onStart(Observation. Overrides default io. Doc from io. Reacts to starting of an
| |
| onStop | back to summary |
|---|---|
| public void onStop(Observation. Overrides default io. Doc from io. Reacts to stopping of an
| |
| supportsContext | back to summary |
|---|---|
| public boolean supportsContext(Observation. Implements io. Doc from io. Tells the registry whether this handler should be applied for a given
| |