Package com.linkedin.davinci.stats
Class StorageEngineOtelStats
java.lang.Object
com.linkedin.davinci.stats.StorageEngineOtelStats
- All Implemented Interfaces:
Closeable,AutoCloseable
Per-store OTel stats for storage engine metrics.
Holds 3 OTel metrics:
ingestion.disk.used— ASYNC_GAUGE with VERSION_ROLE + RECORD_TYPE dimensions, implemented viaAsyncMetricEntityStateTwoEnums<VeniceRecordType, VersionRole>.rocksdb.key.estimated_count— ASYNC_GAUGE with VERSION_ROLE dimensionrocksdb.open.failure_count— COUNTER with VERSION_ROLE dimension
Tehuti metrics are managed separately by
AggVersionedStorageEngineStats.StorageEngineStatsReporter.
-
Constructor Summary
ConstructorsConstructorDescriptionStorageEngineOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Clears internal wrapper references so ASYNC_GAUGE callbacks return 0 (not stale values).voidonVersionRemoved(int version) Removes a version's wrapper when the version is cleaned up.voidrecordRocksDBOpenFailure(int version) Records a RocksDB open failure for a specific version as a COUNTER increment.voidsetStatsWrapper(int version, com.linkedin.davinci.stats.AggVersionedStorageEngineStats.StorageEngineStatsWrapper wrapper) Registers a wrapper for a specific version, enabling ASYNC_GAUGE callbacks to resolve data.voidupdateVersionInfo(int currentVersion, int futureVersion) Updates the current and future version for this store.
-
Constructor Details
-
StorageEngineOtelStats
-
-
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
rocksDBOpenFailureCounton theAggVersionedStorageEngineStats.StorageEngineStatsWrapperfor 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-