Class Observations

java.lang.Object
io.micrometer.observation.Observations

public final class Observations extends Object
Generator of observations bound to a static global registry. For use especially in places where dependency injection of ObservationRegistry is not possible for an instrumented type.
Since:
1.14.0
  • Method Details

    • setRegistry

      public static void setRegistry(ObservationRegistry registry)
      Sets a registry as the global registry.
      Parameters:
      registry - Registry to set.
    • resetRegistry

      public static void resetRegistry()
      Resets registry to the original, empty one.
    • getGlobalRegistry

      public static ObservationRegistry getGlobalRegistry()
      Retrieves the current global instance.
      Returns:
      Global registry.