Class BlobTransferOtelStats

java.lang.Object
com.linkedin.davinci.stats.BlobTransferOtelStats

public class BlobTransferOtelStats extends Object
OpenTelemetry metrics for blob transfer statistics.

This is a versioned OTel stats class — each instance is per-store. A volatile VersionInfo field tracks the current and future version numbers so recording methods can classify the version being recorded as CURRENT, FUTURE, or BACKUP.

Note: Tehuti metrics are managed separately in BlobTransferStats and BlobTransferStatsReporter. This class handles only OTel metrics.

  • Constructor Details

    • BlobTransferOtelStats

      public BlobTransferOtelStats(io.tehuti.metrics.MetricsRepository metricsRepository, String storeName, String clusterName)
      Constructs a BlobTransferOtelStats instance for a specific store.

      OTel emission is determined solely by the global OTel flag in the VeniceMetricsRepository. A plain MetricsRepository disables OTel emission.

      Parameters:
      metricsRepository - the metrics repository
      storeName - the name of the Venice store
      clusterName - the Venice cluster name
  • Method Details

    • emitOtelMetrics

      public boolean emitOtelMetrics()
    • updateVersionInfo

      public void updateVersionInfo(int currentVersion, int futureVersion)
    • recordResponseCount

      public void recordResponseCount(int version, VeniceResponseStatusCategory status)
      Records a blob transfer response count with SUCCESS or FAIL status.

      Consolidates the 3 Tehuti sensors (total/success/fail) into 1 OTel COUNTER with a VeniceResponseStatusCategory dimension. The total is the sum of SUCCESS and FAIL in OTel, so there is no separate total recording.

    • recordTime

      public void recordTime(int version, double timeInSec)
      Records blob transfer time in seconds.
      Parameters:
      version - the store version
      timeInSec - the blob transfer time in seconds
    • recordBytesReceived

      public void recordBytesReceived(int version, long bytes)
      Records bytes received via blob transfer.
      Parameters:
      version - the store version
      bytes - the number of bytes received
    • recordBytesSent

      public void recordBytesSent(int version, long bytes)
      Records bytes sent via blob transfer.
      Parameters:
      version - the store version
      bytes - the number of bytes sent