Class MetricData


  • @Immutable
    public abstract class MetricData
    extends Object
    A MetricData represents the data exported as part of aggregating one Instrument.
    • Method Detail

      • createDoubleGauge

        public static MetricData createDoubleGauge​(io.opentelemetry.sdk.resources.Resource resource,
                                                   io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo,
                                                   String name,
                                                   String description,
                                                   String unit,
                                                   MetricData.DoubleGaugeData data)
      • createLongGauge

        public static MetricData createLongGauge​(io.opentelemetry.sdk.resources.Resource resource,
                                                 io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo,
                                                 String name,
                                                 String description,
                                                 String unit,
                                                 MetricData.LongGaugeData data)
      • createDoubleSum

        public static MetricData createDoubleSum​(io.opentelemetry.sdk.resources.Resource resource,
                                                 io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo,
                                                 String name,
                                                 String description,
                                                 String unit,
                                                 MetricData.DoubleSumData data)
      • createLongSum

        public static MetricData createLongSum​(io.opentelemetry.sdk.resources.Resource resource,
                                               io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo,
                                               String name,
                                               String description,
                                               String unit,
                                               MetricData.LongSumData data)
      • createDoubleSummary

        public static MetricData createDoubleSummary​(io.opentelemetry.sdk.resources.Resource resource,
                                                     io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo,
                                                     String name,
                                                     String description,
                                                     String unit,
                                                     MetricData.DoubleSummaryData data)
      • getResource

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

        public abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()
        Returns the instrumentation library specified when creating the Meter which created the Instrument that produces MetricData.
        Returns:
        an instance of InstrumentationLibraryInfo
      • getName

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

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

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

        public abstract MetricData.Type getType()
        Returns the type of this metric.
        Returns:
        the type of this metric.
      • isEmpty

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