Class RecordLevelDelayOtelStats
java.lang.Object
com.linkedin.davinci.stats.ingestion.heartbeat.RecordLevelDelayOtelStats
OpenTelemetry metrics for record-level delay monitoring.
Tracks delays for regular data records (not heartbeat control messages).
SLO classification dimensions (VeniceStoreWriteType, VeniceChunkingStatus,
VeniceRegionLocality) are supplied by the caller on every record so they reflect the
version-level configuration the caller resolved (rather than store-level approximations baked
in at construction time). Write-type and chunking are emitted as dynamic dimensions; locality
stays a base dimension because it is a deterministic function of the source region — caller
provides the resolved enum on the first call per region, and it is cached in that region's
MetricEntityStateFiveEnums instance.
Note: Tehuti metrics are managed separately in HeartbeatStatReporter.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordLevelDelayOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Clears the per-region metric state map, releasing references to MetricEntityState objects.booleanReturns true if OTel metrics are emitted.voidrecordRecordDelayOtelMetrics(int version, String region, ReplicaType replicaType, ReplicaState replicaState, VeniceStoreWriteType writeType, VeniceChunkingStatus chunkingStatus, VeniceRegionLocality locality, long delayMs) Records a record-level delay with all dimensional attributes to OTel metrics.voidupdateVersionInfo(int currentVersion, int futureVersion) Updates the current and future version for this store.
-
Constructor Details
-
RecordLevelDelayOtelStats
-
-
Method Details
-
emitOtelMetrics
public boolean emitOtelMetrics()Returns true if OTel metrics are emitted. -
updateVersionInfo
public void updateVersionInfo(int currentVersion, int futureVersion) Updates the current and future version for this store.- Parameters:
currentVersion- The current serving versionfutureVersion- The future/upcoming version
-
recordRecordDelayOtelMetrics
public void recordRecordDelayOtelMetrics(int version, String region, ReplicaType replicaType, ReplicaState replicaState, VeniceStoreWriteType writeType, VeniceChunkingStatus chunkingStatus, VeniceRegionLocality locality, long delayMs) Records a record-level delay with all dimensional attributes to OTel metrics. Returns early only when OTel emission is disabled. Version classification is best-effort:OtelVersionedStatsUtils.classifyVersion(int, com.linkedin.davinci.stats.OtelVersionedStatsUtils.VersionInfo)returnsVersionRole.BACKUPfor any version that is neither current nor future — including unknown/0/-1 — and emission still proceeds.- Parameters:
version- The version number (used to classify VersionRole as CURRENT/FUTURE/BACKUP)region- The record's source regionreplicaType- The replica typeReplicaTypereplicaState- The replica stateReplicaStatewriteType- Pre-resolved write-type label (REGULAR / WRITE_COMPUTE)chunkingStatus- Pre-resolved chunking label (CHUNKED / UNCHUNKED)locality- Pre-resolved locality label (LOCAL / REMOTE) — applied to the per-region metric state on first call per region; subsequent calls reuse the cached statedelayMs- The delay in milliseconds
-
getVersionInfo
-
close
public void close()Clears the per-region metric state map, releasing references to MetricEntityState objects. Does not deregister OTel instruments from the metrics repository — they will be cleaned up when the Meter/MeterProvider is closed or the SDK shuts down.
-