Interface MetricData
@Immutable
public interface MetricData
A
MetricDataImpl represents the data exported as part of aggregating one
Instrument.-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 MetricDatacreateExponentialHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, ExponentialHistogramData data) Returns a new MetricData with aMetricDataType.EXPONENTIAL_HISTOGRAMtype.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.Data<?>getData()Returns the description of this metric.default DoubleGaugeDataReturns theDoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.default DoubleHistogramDataReturns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.default DoubleSumDataReturns theDoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.default DoubleSummaryDataReturns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.default ExponentialHistogramDataReturns theExponentialHistogramDataif type isMetricDataType.EXPONENTIAL_HISTOGRAM, otherwise a default empty data.io.opentelemetry.sdk.common.InstrumentationLibraryInfoReturns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.default LongGaugeDataReturns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.default LongSumDataReturns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.getName()Returns the metric name.io.opentelemetry.sdk.resources.ResourceReturns the resource of thisMetricData.getType()Returns the type of this metric.getUnit()Returns the unit of this metric.default booleanisEmpty()Returnstrueif there are no points associated with this metric.
-
Method Details
-
createDoubleGauge
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
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
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
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
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
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.
-
createExponentialHistogram
static MetricData createExponentialHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, ExponentialHistogramData data) Returns a new MetricData with aMetricDataType.EXPONENTIAL_HISTOGRAMtype.- Returns:
- a new MetricData wih a
MetricDataType.EXPONENTIAL_HISTOGRAMtype.
-
getResource
io.opentelemetry.sdk.resources.Resource getResource()Returns the resource of thisMetricData.- Returns:
- the resource of this
MetricData.
-
getInstrumentationLibraryInfo
io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.- Returns:
- an instance of
InstrumentationLibraryInfo
-
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()Returnstrueif there are no points associated with this metric.- Returns:
trueif there are no points associated with this metric.
-
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
Returns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.- Returns:
- the
LongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.
-
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
Returns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.- Returns:
- the
LongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.
-
getDoubleSummaryData
Returns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.- Returns:
- the
DoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default * empty data.
-
getDoubleHistogramData
Returns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.- Returns:
- the
DoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.
-
getExponentialHistogramData
Returns theExponentialHistogramDataif type isMetricDataType.EXPONENTIAL_HISTOGRAM, otherwise a default empty data.- Returns:
- the
ExponentialHistogramDataif type isMetricDataType.EXPONENTIAL_HISTOGRAM, otherwise a default empty data.
-