Class RecordLevelDelayOtelStats

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

public class RecordLevelDelayOtelStats extends Object
OpenTelemetry metrics for record-level delay monitoring. Tracks delays for regular data records (not heartbeat control messages). Note: Tehuti metrics are managed separately in HeartbeatStatReporter.
  • Constructor Details

    • RecordLevelDelayOtelStats

      public RecordLevelDelayOtelStats(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
    • recordRecordDelayOtelMetrics

      public void recordRecordDelayOtelMetrics(int version, String region, ReplicaType replicaType, ReplicaState replicaState, long delayMs)
      Records a record-level delay with all dimensional attributes to OTel metrics. Returns early if OTel metrics are disabled or version is invalid.
      Parameters:
      version - The version number
      region - The region name
      replicaType - The replica type ReplicaType
      replicaState - The replica state ReplicaState
      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.