Interface MetricData


@Immutable public interface MetricData
A ImmutableMetricData represents the data exported as part of aggregating one Instrument.
  • Method Details

    • getResource

      io.opentelemetry.sdk.resources.Resource getResource()
      Returns the resource of this MetricData.
      Returns:
      the resource of this MetricData.
    • getInstrumentationScopeInfo

      io.opentelemetry.sdk.common.InstrumentationScopeInfo getInstrumentationScopeInfo()
      Returns the instrumentation scope specified when creating the Meter which created the Instrument that produces MetricData.
      Returns:
      an instance of InstrumentationScopeInfo
    • getName

      String getName()
      Returns the metric name.
      Returns:
      the metric name.
    • getDescription

      String getDescription()
      Returns the description of this metric.
      Returns:
      the description of this metric.
    • getUnit

      String getUnit()
      Returns the unit of this metric.
      Returns:
      the unit of this metric.
    • getType

      MetricDataType getType()
      Returns the type of this metric.
      Returns:
      the type of this metric.
    • getData

      Data<?> getData()
    • isEmpty

      default boolean isEmpty()
      Returns true if there are no points associated with this metric.
      Returns:
      true if there are no points associated with this metric.
    • getDoubleGaugeData

      default GaugeData<DoublePointData> getDoubleGaugeData()
      Returns the DoubleGaugeData if type is MetricDataType.DOUBLE_GAUGE, otherwise a default empty data.
      Returns:
      the DoubleGaugeData if type is MetricDataType.DOUBLE_GAUGE, otherwise a default empty data.
    • getLongGaugeData

      default GaugeData<LongPointData> getLongGaugeData()
      Returns the LongGaugeData if type is MetricDataType.LONG_GAUGE, otherwise a default empty data.
      Returns:
      the LongGaugeData if type is MetricDataType.LONG_GAUGE, otherwise a default empty data.
    • getDoubleSumData

      default SumData<DoublePointData> getDoubleSumData()
      Returns the DoubleSumData if type is MetricDataType.DOUBLE_SUM, otherwise a default empty data.
      Returns:
      the DoubleSumData if type is MetricDataType.DOUBLE_SUM, otherwise a default empty data.
    • getLongSumData

      default SumData<LongPointData> getLongSumData()
      Returns the LongSumData if type is MetricDataType.LONG_SUM, otherwise a default empty data.
      Returns:
      the LongSumData if type is MetricDataType.LONG_SUM, otherwise a default empty data.
    • getSummaryData

      default SummaryData getSummaryData()
      Returns the DoubleSummaryData if type is MetricDataType.SUMMARY, otherwise a default empty data.
      Returns:
      the DoubleSummaryData if type is MetricDataType.SUMMARY, otherwise a default * empty data.
    • getHistogramData

      default HistogramData getHistogramData()
      Returns the DoubleHistogramData if type is MetricDataType.HISTOGRAM, otherwise a default empty data.
      Returns:
      the DoubleHistogramData if type is MetricDataType.HISTOGRAM, otherwise a default empty data.