Package io.micrometer.observation
Interface ObservationConvention<T extends Observation.Context>
- Type Parameters:
T
- type of context
- All Superinterfaces:
KeyValuesConvention
- All Known Subinterfaces:
GlobalObservationConvention<T>
Contains conventions for naming and
KeyValues
providing.- Since:
- 1.10.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ObservationConvention
<Observation.Context> Empty instance of the convention. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
getContextualName
(T context) Allows to override the contextual name for anObservation
.default io.micrometer.common.KeyValues
getHighCardinalityKeyValues
(T context) High cardinality key values.default io.micrometer.common.KeyValues
getLowCardinalityKeyValues
(T context) Low cardinality key values.default String
getName()
Allows to override the name for an observation.boolean
supportsContext
(Observation.Context context) Tells whether this observation convention should be applied for a givenObservation.Context
.
-
Field Details
-
EMPTY
Empty instance of the convention.
-
-
Method Details
-
getLowCardinalityKeyValues
Low cardinality key values.- Returns:
- key values
-
getHighCardinalityKeyValues
High cardinality key values.- Returns:
- key values
-
supportsContext
Tells whether this observation convention should be applied for a givenObservation.Context
.- Parameters:
context
- anObservation.Context
- Returns:
true
when this observation convention should be used
-
getName
Allows to override the name for an observation.- Returns:
- the new name for the observation
-
getContextualName
Allows to override the contextual name for anObservation
. TheObservation
will be renamed only when an explicit context was passed - if an implicit context is used this method won't be called.- Parameters:
context
- context- Returns:
- the new, contextual name for the observation
-