Interface ObservationHandlerGroup

All Superinterfaces:
Comparable<ObservationHandlerGroup>

public interface ObservationHandlerGroup extends Comparable<ObservationHandlerGroup>
Group of ObservationHandlers that can be registered together. The first group claiming membership of a handler is responsible for registering it. Groups are Comparable so that they can be ordered against each other.
Since:
4.0.0
Author:
Phillip Webb
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    Return the primary type of handler that this group accepts.
    default boolean
    isMember(io.micrometer.observation.ObservationHandler<?> handler)
    Return if the given handler is a member of this group.
    static <H extends io.micrometer.observation.ObservationHandler<?>>
    ObservationHandlerGroup
    of(Class<H> handlerType)
    Static factory method to create an ObservationHandlerGroup with members of the given handler type.
    default void
    registerMembers(io.micrometer.observation.ObservationRegistry.ObservationConfig config, List<io.micrometer.observation.ObservationHandler<?>> members)
    Register group members against the given ObservationRegistry.ObservationConfig.
  • Method Details

    • isMember

      default boolean isMember(io.micrometer.observation.ObservationHandler<?> handler)
      Return if the given handler is a member of this group.
      Parameters:
      handler - the handler to check
      Returns:
      if the handler is a member
    • registerMembers

      default void registerMembers(io.micrometer.observation.ObservationRegistry.ObservationConfig config, List<io.micrometer.observation.ObservationHandler<?>> members)
      Register group members against the given ObservationRegistry.ObservationConfig.
      Parameters:
      config - the config used to register members
      members - the group members to register
    • compareTo

      default int compareTo(ObservationHandlerGroup other)
      Specified by:
      compareTo in interface Comparable<ObservationHandlerGroup>
    • handlerType

      Class<?> handlerType()
      Return the primary type of handler that this group accepts.
      Returns:
      the accepted handler type
    • of

      static <H extends io.micrometer.observation.ObservationHandler<?>> ObservationHandlerGroup of(Class<H> handlerType)
      Static factory method to create an ObservationHandlerGroup with members of the given handler type.
      Type Parameters:
      H - the handler type
      Parameters:
      handlerType - the handler type
      Returns:
      a new ObservationHandlerGroup