Class HeartbeatOtelStats

java.lang.Object
com.linkedin.davinci.stats.ingestion.heartbeat.HeartbeatOtelStats

public class HeartbeatOtelStats extends Object
OpenTelemetry metrics for heartbeat monitoring. Note: Tehuti metrics are managed separately in HeartbeatStatReporter.
  • Constructor Details

    • HeartbeatOtelStats

      public HeartbeatOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName)
  • 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 version
      futureVersion - The future/upcoming version
    • recordHeartbeatDelayOtelMetrics

      public void recordHeartbeatDelayOtelMetrics(int version, String region, ReplicaType replicaType, ReplicaState replicaState, VeniceStoreWriteType writeType, VeniceChunkingStatus chunkingStatus, VeniceRegionLocality locality, long delayMs)
      Records a heartbeat delay with all dimensional attributes to OTel metrics. Returns early if OTel metrics are disabled.
      Parameters:
      version - The version number
      region - The region name
      replicaType - The replica type ReplicaType
      replicaState - The replica state ReplicaState
      writeType - Pre-resolved store write-type label (REGULAR / WRITE_COMPUTE)
      chunkingStatus - Pre-resolved version-level 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 state. Null is coerced to REMOTE: from the perspective of an unconfigured server, every source region is "not the local region".
      delayMs - The delay in milliseconds
    • getVersionInfo

      public OtelVersionedStatsUtils.VersionInfo 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.