Package io.micrometer.observation
Interface ObservationRegistry
public interface ObservationRegistry
Implementations of this interface are responsible for managing state of an
Observation
.- Since:
- 1.10.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Access to configuration options for this registry. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ObservationRegistry
No-op implementation ofObservationRegistry
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ObservationRegistry
create()
Creates an instance ofObservationRegistry
.When previously set will allow to retrieve theObservation
at any point in time.When previously set will allow to retrieve theObservation.Scope
at any point in time.default boolean
isNoop()
Checks whether thisObservationRegistry
is no-op.Configuration options for this registry.void
Sets the observation scope as current.
-
Field Details
-
NOOP
No-op implementation ofObservationRegistry
.
-
-
Method Details
-
create
Creates an instance ofObservationRegistry
.- Returns:
ObservationRegistry
instance
-
getCurrentObservation
When previously set will allow to retrieve theObservation
at any point in time. Example: if anObservation
was put inObservation.Scope
then this method will return the current presentObservation
within the scope.- Returns:
- current observation or
null
if it's not present
-
getCurrentObservationScope
When previously set will allow to retrieve theObservation.Scope
at any point in time. Example: if anObservation
was put inObservation.Scope
then this method will return the current presentObservation.Scope
.- Returns:
- current observation scope or
null
if it's not present
-
setCurrentObservationScope
Sets the observation scope as current.- Parameters:
current
- observation scope
-
observationConfig
ObservationRegistry.ObservationConfig observationConfig()Configuration options for this registry.- Returns:
- observation configuration
-
isNoop
default boolean isNoop()Checks whether thisObservationRegistry
is no-op.- Returns:
true
when this is a no-op observation registry
-