Package com.linkedin.davinci.stats
Class NativeMetadataRepositoryStats
java.lang.Object
com.linkedin.venice.stats.AbstractVeniceStats
com.linkedin.davinci.stats.NativeMetadataRepositoryStats
Tracks metadata cache staleness for
NativeMetadataRepository.
Tehuti emits a single high-watermark gauge (oldest store's staleness across all stores). OTel emits per-store ASYNC_DOUBLE_GAUGE with STORE_NAME dimension — backends can compute the high watermark at query time via max aggregation.
Per-store OTel callbacks are registered lazily on first updateCacheTimestamp(java.lang.String, java.lang.String, long) call
and read from the shared metadataCacheTimestampMapInMs. When a store is removed,
the callback returns NaN (timestamp absent from the map, store no longer tracked). OTel callbacks cannot be
deregistered (SDK limitation), so the per-store entry stays registered until the process exits.
-
Field Summary
Fields inherited from class com.linkedin.venice.stats.AbstractVeniceStats
DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionNativeMetadataRepositoryStats(io.tehuti.metrics.MetricsRepository metricsRepository, String name, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionfinal doublevoidremoveCacheTimestamp(String storeName) voidupdateCacheTimestamp(String storeName, String clusterName, long cacheTimeStampInMs) Updates the cache timestamp for a store and lazily registers an OTel gauge on first call per store.Methods inherited from class com.linkedin.venice.stats.AbstractVeniceStats
avgAndMax, avgAndTotal, getMetricFullName, getMetricsRepository, getName, getSensorFullName, getSensorFullName, isTotalStats, minAndMax, registerOnlyTotalRate, registerOnlyTotalSensor, registerPerStoreAndTotal, registerPerStoreAndTotalSensor, registerSensor, registerSensor, registerSensor, registerSensor, registerSensorAttributeGauge, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorIfAbsent, registerSensorWithAggregate, registerSensorWithAggregate, unregisterAllSensors
-
Constructor Details
-
NativeMetadataRepositoryStats
-
-
Method Details
-
getMetadataStalenessHighWatermarkMs
public final double getMetadataStalenessHighWatermarkMs() -
updateCacheTimestamp
Updates the cache timestamp for a store and lazily registers an OTel gauge on first call per store.- Parameters:
clusterName- used only on the first call per store to set the CLUSTER_NAME OTel dimension. Subsequent calls for the same store ignore this parameter — the OTel gauge is already registered under the first-seen cluster name and OTel callbacks cannot be deregistered. Known limitation: if a store migrates clusters during the lifetime of this process, the gauge will continue to emit under the original cluster name dimension rather than the post-migration cluster.
-
removeCacheTimestamp
-