Class StorageEngineOtelStats

java.lang.Object
com.linkedin.davinci.stats.StorageEngineOtelStats
All Implemented Interfaces:
Closeable, AutoCloseable

public class StorageEngineOtelStats extends Object implements Closeable
Per-store OTel stats for storage engine metrics.

Holds 3 OTel metrics:

  • ingestion.disk.used — ASYNC_GAUGE with VERSION_ROLE + RECORD_TYPE dimensions, implemented via AsyncMetricEntityStateTwoEnums<VeniceRecordType, VersionRole>.
  • rocksdb.key.estimated_count — ASYNC_GAUGE with VERSION_ROLE dimension
  • rocksdb.open.failure_count — COUNTER with VERSION_ROLE dimension

Tehuti metrics are managed separately by AggVersionedStorageEngineStats.StorageEngineStatsReporter.

  • Constructor Summary

    Constructors
    Constructor
    Description
    StorageEngineOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears internal wrapper references so ASYNC_GAUGE callbacks return 0 (not stale values).
    void
    onVersionRemoved(int version)
    Removes a version's wrapper when the version is cleaned up.
    void
    Records a RocksDB open failure for a specific version as a COUNTER increment.
    void
    setStatsWrapper(int version, com.linkedin.davinci.stats.AggVersionedStorageEngineStats.StorageEngineStatsWrapper wrapper)
    Registers a wrapper for a specific version, enabling ASYNC_GAUGE callbacks to resolve data.
    void
    updateVersionInfo(int currentVersion, int futureVersion)
    Updates the current and future version for this store.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StorageEngineOtelStats

      public StorageEngineOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName)
  • Method Details

    • updateVersionInfo

      public void updateVersionInfo(int currentVersion, int futureVersion)
      Updates the current and future version for this store.
    • setStatsWrapper

      public void setStatsWrapper(int version, com.linkedin.davinci.stats.AggVersionedStorageEngineStats.StorageEngineStatsWrapper wrapper)
      Registers a wrapper for a specific version, enabling ASYNC_GAUGE callbacks to resolve data.
    • onVersionRemoved

      public void onVersionRemoved(int version)
      Removes a version's wrapper when the version is cleaned up.
    • recordRocksDBOpenFailure

      public void recordRocksDBOpenFailure(int version)
      Records a RocksDB open failure for a specific version as a COUNTER increment.

      Semantic divergence: OTel COUNTER increments at recording time, permanently labeling each failure with the version's role at that moment. Tehuti AsyncGauge polls rocksDBOpenFailureCount on the AggVersionedStorageEngineStats.StorageEngineStatsWrapper for the version currently bound to the reporter's role slot. Wrappers are per-version (not per-role): the failure count accumulates in the wrapper for the version's lifetime. When a role reporter re-binds to a new version's wrapper, the Tehuti gauge reflects that version's cumulative count. Old wrapper counts are no longer polled but are not reset.

    • close

      public void close()
      Clears internal wrapper references so ASYNC_GAUGE callbacks return 0 (not stale values). OTel instruments registered with the SDK are NOT deregistered — they remain registered and will continue to be polled until the SDK is shut down.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable