Interface MeterConvention<C extends @Nullable Object>

Type Parameters:
C - context type used to derive tags
All Known Implementing Classes:
SimpleMeterConvention

@NullUnmarked public interface MeterConvention<C extends @Nullable Object>
Convention describing a Meter used for a specific instrumentation. Different implementations of this convention may change the convention used by the same instrumentation logic. If the instrumentation is timing an operation, consider using the Observation API and ObservationConvention instead. MeterConvention is for instrumentation that is instrumented directly with the metrics API.

This is a distinct concept from NamingConvention. The name provided by the MeterConvention is the canonical name, which will potentially be transformed by a NamingConvention for a specific metrics backend or format.

Since:
1.16.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull String
    Canonical name of the meter.
    default @NonNull Tags
    getTags(C context)
    Tags specific to this meter convention.
  • Method Details

    • getName

      @NonNull String getName()
      Canonical name of the meter.
      Returns:
      meter name
    • getTags

      default @NonNull Tags getTags(C context)
      Tags specific to this meter convention. Generally they should be combined with any common tags if this convention is associated with other conventions that share tags.
      Parameters:
      context - optional context which may be used for deriving tags
      Returns:
      tags instance to use with the meter described by this convention