Class MetricData
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.data.MetricData
-
@Immutable public abstract class MetricData extends Object
AMetricDatarepresents the data exported as part of aggregating oneInstrument.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MetricDatacreateDoubleGauge(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleGaugeData data)Returns a new MetricData wih aMetricDataType.DOUBLE_GAUGEtype.static MetricDatacreateDoubleHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleHistogramData data)Returns a new MetricData with aMetricDataType.HISTOGRAMtype.static MetricDatacreateDoubleSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleSumData data)Returns a new MetricData wih aMetricDataType.DOUBLE_SUMtype.static MetricDatacreateDoubleSummary(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleSummaryData data)Returns a new MetricData wih aMetricDataType.SUMMARYtype.static MetricDatacreateLongGauge(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, LongGaugeData data)Returns a new MetricData wih aMetricDataType.LONG_GAUGEtype.static MetricDatacreateLongSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, LongSumData data)Returns a new MetricData wih aMetricDataType.LONG_SUMtype.abstract StringgetDescription()Returns the description of this metric.DoubleGaugeDatagetDoubleGaugeData()Returns theDoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.DoubleHistogramDatagetDoubleHistogramData()Returns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.DoubleSumDatagetDoubleSumData()Returns theDoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.DoubleSummaryDatagetDoubleSummaryData()Returns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.LongGaugeDatagetLongGaugeData()Returns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.LongSumDatagetLongSumData()Returns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.abstract StringgetName()Returns the metric name.abstract io.opentelemetry.sdk.resources.ResourcegetResource()Returns the resource of thisMetricData.abstract MetricDataTypegetType()Returns the type of this metric.abstract StringgetUnit()Returns the unit of this metric.booleanisEmpty()Returnstrueif there are no points associated with this metric.
-
-
-
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, DoubleGaugeData data)
Returns a new MetricData wih aMetricDataType.DOUBLE_GAUGEtype.- Returns:
- a new MetricData wih a
MetricDataType.DOUBLE_GAUGEtype.
-
createLongGauge
public static MetricData createLongGauge(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, LongGaugeData data)
Returns a new MetricData wih aMetricDataType.LONG_GAUGEtype.- Returns:
- a new MetricData wih a
MetricDataType.LONG_GAUGEtype.
-
createDoubleSum
public static MetricData createDoubleSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleSumData data)
Returns a new MetricData wih aMetricDataType.DOUBLE_SUMtype.- Returns:
- a new MetricData wih a
MetricDataType.DOUBLE_SUMtype.
-
createLongSum
public static MetricData createLongSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, LongSumData data)
Returns a new MetricData wih aMetricDataType.LONG_SUMtype.- Returns:
- a new MetricData wih a
MetricDataType.LONG_SUMtype.
-
createDoubleSummary
public static MetricData createDoubleSummary(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleSummaryData data)
Returns a new MetricData wih aMetricDataType.SUMMARYtype.- Returns:
- a new MetricData wih a
MetricDataType.SUMMARYtype.
-
createDoubleHistogram
public static MetricData createDoubleHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, DoubleHistogramData data)
Returns a new MetricData with aMetricDataType.HISTOGRAMtype.- Returns:
- a new MetricData wih a
MetricDataType.HISTOGRAMtype.
-
getResource
public abstract io.opentelemetry.sdk.resources.Resource getResource()
Returns the resource of thisMetricData.- Returns:
- the resource of this
MetricData.
-
getInstrumentationLibraryInfo
public abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.- 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 MetricDataType getType()
Returns the type of this metric.- Returns:
- the type of this metric.
-
isEmpty
public boolean isEmpty()
Returnstrueif there are no points associated with this metric.- Returns:
trueif there are no points associated with this metric.
-
getDoubleGaugeData
public final DoubleGaugeData getDoubleGaugeData()
Returns theDoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.- Returns:
- the
DoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.
-
getLongGaugeData
public final LongGaugeData getLongGaugeData()
Returns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.- Returns:
- the
LongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.
-
getDoubleSumData
public final DoubleSumData getDoubleSumData()
Returns theDoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.- Returns:
- the
DoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.
-
getLongSumData
public final LongSumData getLongSumData()
Returns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.- Returns:
- the
LongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.
-
getDoubleSummaryData
public final DoubleSummaryData getDoubleSummaryData()
Returns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.- Returns:
- the
DoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default * empty data.
-
getDoubleHistogramData
public final DoubleHistogramData getDoubleHistogramData()
Returns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.- Returns:
- the
DoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.
-
-