Interface ObservationConvention<T extends Observation.Context>

Type Parameters:
T - type of context
All Superinterfaces:
KeyValuesConvention
All Known Subinterfaces:
GlobalObservationConvention<T>

public interface ObservationConvention<T extends Observation.Context> extends KeyValuesConvention
Contains conventions for naming and KeyValues providing.
Since:
1.10.0
  • Field Details

  • Method Details

    • getLowCardinalityKeyValues

      default io.micrometer.common.KeyValues getLowCardinalityKeyValues(T context)
      Low cardinality key values.
      Returns:
      key values
    • getHighCardinalityKeyValues

      default io.micrometer.common.KeyValues getHighCardinalityKeyValues(T context)
      High cardinality key values.
      Returns:
      key values
    • supportsContext

      boolean supportsContext(Observation.Context context)
      Tells whether this observation convention should be applied for a given Observation.Context.
      Parameters:
      context - an Observation.Context
      Returns:
      true when this observation convention should be used
    • getName

      @Nullable default String getName()
      Allows to override the name for an observation.
      Returns:
      the new name for the observation
    • getContextualName

      @Nullable 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 - context
      Returns:
      the new, contextual name for the observation