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
FieldsModifier and TypeFieldDescriptionstatic final ObservationConvention<Observation.Context> Empty instance of the convention. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetContextualName(T context) Allows to override the contextual name for anObservation.default io.micrometer.common.KeyValuesgetHighCardinalityKeyValues(T context) High cardinality key values.default io.micrometer.common.KeyValuesgetLowCardinalityKeyValues(T context) Low cardinality key values.default StringgetName()Allows to override the name for an observation.booleansupportsContext(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:
truewhen 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. TheObservationwill 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
-