Top Description Fields Methods
io.micrometer.observation

public Interface ObservationConvention<T extends Observation.Context>

extends KeyValuesConvention
Known Direct Subinterfaces
io.micrometer.observation.GlobalObservationConvention
Known Direct Implementers
io.micrometer.observation.NoopObservationConvention
Type Parameters
<T>
type of context
Imports
io.micrometer.common.KeyValues, io.micrometer.common.lang.Nullable

Contains conventions for naming and KeyValues providing.
Author
Marcin Grzejszczak
Since
1.10.0

Field Summary

Modifier and TypeField and Description
public static final ObservationConvention<Observation.Context>
EMPTY

Empty instance of the convention.

Method Summary

Modifier and TypeMethod and Description
public default String

Returns:

the new, contextual name for the observation
getContextualName
(T
context
context
)

Allows to override the contextual name for an Observation.

public default KeyValues

Returns:

key values
getHighCardinalityKeyValues
(T context)

High cardinality key values.

public default KeyValues

Returns:

key values
getLowCardinalityKeyValues
(T context)

Low cardinality key values.

public default String

Returns:

the new name for the observation
getName
()

Allows to override the name for an observation.

public boolean

Returns:

true when this observation convention should be used
supportsContext
(Observation.Context context)

Tells whether this observation convention should be applied for a given Observation.

Field Detail

EMPTYback to summary
public static final ObservationConvention<Observation.Context> EMPTY

Empty instance of the convention.

Method Detail

getContextualNameback to summary
public default String getContextualName(T context)

Allows to override the contextual name for an Observation. The Observation will be renamed only when an explicit context was passed - if an implicit context is used this method won't be called.

Parameters
context:T

context

Returns:String

the new, contextual name for the observation

Annotations
@Nullable
getHighCardinalityKeyValuesback to summary
public default KeyValues getHighCardinalityKeyValues(T context)

High cardinality key values.

Returns:KeyValues

key values

getLowCardinalityKeyValuesback to summary
public default KeyValues getLowCardinalityKeyValues(T context)

Low cardinality key values.

Returns:KeyValues

key values

getNameback to summary
public default String getName()

Allows to override the name for an observation.

Returns:String

the new name for the observation

Annotations
@Nullable
supportsContextback to summary
public boolean supportsContext(Observation.Context context)

Tells whether this observation convention should be applied for a given Observation.Context.

Parameters
context:Observation.Context

an Observation.Context

Returns:boolean

true when this observation convention should be used