Enum Class MetricType

java.lang.Object
java.lang.Enum<MetricType>
com.linkedin.venice.stats.metrics.MetricType
All Implemented Interfaces:
Serializable, Comparable<MetricType>, Constable

public enum MetricType extends Enum<MetricType>
Metric type enum to define the type of metrics Venice supports via OpenTelemetry
  • Enum Constant Details

    • HISTOGRAM

      public static final MetricType HISTOGRAM
      Use Histogram to get percentiles/min/max/count/sum and other aggregates: can be configured to be exponential or explicit bucket
      check VeniceMetricsConfig.Builder.extractAndSetOtelConfigs(java.util.Map<java.lang.String, java.lang.String>) for more details
    • MIN_MAX_COUNT_SUM_AGGREGATIONS

      public static final MetricType MIN_MAX_COUNT_SUM_AGGREGATIONS
      To get min/max/count/sum aggregation without the memory overhead to calculate percentiles, use Otel Explicit bucket Histogram but without buckets . check VeniceOpenTelemetryMetricsRepository.createDoubleHistogram(com.linkedin.venice.stats.metrics.MetricEntity) and VeniceOpenTelemetryMetricsRepository.setExponentialHistogramAggregation(io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder, com.linkedin.venice.stats.VeniceMetricsConfig) for more details
    • COUNTER

      public static final MetricType COUNTER
      For Counter: A simple counter that can be added to.
    • ASYNC_COUNTER_FOR_HIGH_PERF_CASES

      public static final MetricType ASYNC_COUNTER_FOR_HIGH_PERF_CASES
      Use this instead of COUNTER when recording happens at very high frequency in hot path.

      Uses LongAdder internally for fast recording, and OpenTelemetry's ObservableLongCounter reads the accumulated values during metrics collection.

    • UP_DOWN_COUNTER

      public static final MetricType UP_DOWN_COUNTER
      For UpDownCounter: A counter that supports positive and negative increments. Useful when counts can increase or decrease over time.
    • ASYNC_UP_DOWN_COUNTER_FOR_HIGH_PERF_CASES

      public static final MetricType ASYNC_UP_DOWN_COUNTER_FOR_HIGH_PERF_CASES
      Use this instead of UP_DOWN_COUNTER when recording happens at very high frequency in hot path.

      Uses LongAdder internally for fast recording, and OpenTelemetry's ObservableLongUpDownCounter reads the accumulated values during metrics collection. Supports both positive and negative values.

    • GAUGE

      public static final MetricType GAUGE
      LongGauge: Emits the absolute value of the metric value.
    • ASYNC_GAUGE

      public static final MetricType ASYNC_GAUGE
      For Async Gauge: Emits the absolute value of the metric value asynchronously. Refer ObservableLongGauge
  • Method Details

    • values

      public static MetricType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MetricType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isAsyncMetric

      public boolean isAsyncMetric()
    • isObservableCounterType

      public boolean isObservableCounterType()
      Checks if this metric type is an observable counter type that uses LongAdder internally for high-performance recording.