Class OtelStatsLogger

java.lang.Object
org.apache.bookkeeper.stats.otel.OtelStatsLogger
All Implemented Interfaces:
StatsLogger

public class OtelStatsLogger extends Object implements StatsLogger
  • Constructor Details

    • OtelStatsLogger

      OtelStatsLogger(OtelMetricsProvider provider, String scope, io.opentelemetry.api.common.Attributes attributes)
  • Method Details

    • getOpStatsLogger

      public OpStatsLogger getOpStatsLogger(String name)
      Specified by:
      getOpStatsLogger in interface StatsLogger
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for an OpStat described by the name.
    • getThreadScopedOpStatsLogger

      public OpStatsLogger getThreadScopedOpStatsLogger(String name)
      Specified by:
      getThreadScopedOpStatsLogger in interface StatsLogger
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for an OpStat described by the name with extra labels for the threadpool/threadname and thread no. Lone threads always have 0 as their thread no.
    • getCounter

      public Counter getCounter(String name)
      Specified by:
      getCounter in interface StatsLogger
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for a simple stat described by the name
    • getThreadScopedCounter

      public Counter getThreadScopedCounter(String name)
      Specified by:
      getThreadScopedCounter in interface StatsLogger
      Parameters:
      name - Stats Name
      Returns:
      Get the logger for a simple stat described by the name with extra labels for the threadpool/threadname and thread no. Lone threads always have 0 as their thread no.
    • registerGauge

      public <T extends Number> void registerGauge(String name, Gauge<T> gauge)
      Description copied from interface: StatsLogger
      Register given gauge as name name.
      Specified by:
      registerGauge in interface StatsLogger
      Parameters:
      name - gauge name
      gauge - gauge function
    • unregisterGauge

      public <T extends Number> void unregisterGauge(String name, Gauge<T> gauge)
      Description copied from interface: StatsLogger
      Unregister given gauge from name name.
      Specified by:
      unregisterGauge in interface StatsLogger
      Parameters:
      name - name of the gauge
      gauge - gauge function
    • scope

      public StatsLogger scope(String name)
      Description copied from interface: StatsLogger
      Provide the stats logger under scope name.
      Specified by:
      scope in interface StatsLogger
      Parameters:
      name - scope name.
      Returns:
      stats logger under scope name.
    • removeScope

      public void removeScope(String name, StatsLogger statsLogger)
      Description copied from interface: StatsLogger
      Remove the given statsLogger for scope name. It can be no-op if the underlying stats provider doesn't have the ability to remove scope.
      Specified by:
      removeScope in interface StatsLogger
      Parameters:
      name - name of the scope
      statsLogger - the stats logger of this scope.
    • scopeLabel

      public StatsLogger scopeLabel(String labelName, String labelValue)
      Description copied from interface: StatsLogger
      Provide the stats logger with an attached label.
      Specified by:
      scopeLabel in interface StatsLogger
      Parameters:
      labelName - the name of the label.
      labelValue - the value of the label.
      Returns:
      stats logger under scope name.