Interface MetricData
@Immutable
public interface MetricData
A
MetricDataImpl
represents the data exported as part of aggregating one
Instrument
.-
Method Summary
Modifier and TypeMethodDescriptionstatic MetricData
createDoubleGauge
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, GaugeData<DoublePointData> data) Returns a new MetricData wih aMetricDataType.DOUBLE_GAUGE
type.static MetricData
createDoubleHistogram
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, HistogramData data) Returns a new MetricData with aMetricDataType.HISTOGRAM
type.static MetricData
createDoubleSum
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SumData<DoublePointData> data) Returns a new MetricData wih aMetricDataType.DOUBLE_SUM
type.static MetricData
createDoubleSummary
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SummaryData data) Returns a new MetricData wih aMetricDataType.SUMMARY
type.static MetricData
createExponentialHistogram
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, io.opentelemetry.sdk.metrics.internal.data.exponentialhistogram.ExponentialHistogramData data) Returns a new MetricData with aMetricDataType.EXPONENTIAL_HISTOGRAM
type.static MetricData
createLongGauge
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, GaugeData<LongPointData> data) Returns a new MetricData wih aMetricDataType.LONG_GAUGE
type.static MetricData
createLongSum
(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SumData<LongPointData> data) Returns a new MetricData wih aMetricDataType.LONG_SUM
type.Data<?>
getData()
Returns the description of this metric.default GaugeData<DoublePointData>
Returns theDoubleGaugeData
if type isMetricDataType.DOUBLE_GAUGE
, otherwise a default empty data.default SumData<DoublePointData>
Returns theDoubleSumData
if type isMetricDataType.DOUBLE_SUM
, otherwise a default empty data.default HistogramData
Returns theDoubleHistogramData
if type isMetricDataType.HISTOGRAM
, otherwise a default empty data.io.opentelemetry.sdk.common.InstrumentationLibraryInfo
Returns the instrumentation library specified when creating theMeter
which created theInstrument
that producesMetricData
.default GaugeData<LongPointData>
Returns theLongGaugeData
if type isMetricDataType.LONG_GAUGE
, otherwise a default empty data.default SumData<LongPointData>
Returns theLongSumData
if type isMetricDataType.LONG_SUM
, otherwise a default empty data.getName()
Returns the metric name.io.opentelemetry.sdk.resources.Resource
Returns the resource of thisMetricData
.default SummaryData
Returns theDoubleSummaryData
if type isMetricDataType.SUMMARY
, otherwise a default empty data.getType()
Returns the type of this metric.getUnit()
Returns the unit of this metric.default boolean
isEmpty()
Returnstrue
if 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, GaugeData<DoublePointData> data) Returns a new MetricData wih aMetricDataType.DOUBLE_GAUGE
type.- Returns:
- a new MetricData wih a
MetricDataType.DOUBLE_GAUGE
type.
-
createLongGauge
static MetricData createLongGauge(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, GaugeData<LongPointData> data) Returns a new MetricData wih aMetricDataType.LONG_GAUGE
type.- Returns:
- a new MetricData wih a
MetricDataType.LONG_GAUGE
type.
-
createDoubleSum
static MetricData createDoubleSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SumData<DoublePointData> data) Returns a new MetricData wih aMetricDataType.DOUBLE_SUM
type.- Returns:
- a new MetricData wih a
MetricDataType.DOUBLE_SUM
type.
-
createLongSum
static MetricData createLongSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SumData<LongPointData> data) Returns a new MetricData wih aMetricDataType.LONG_SUM
type.- Returns:
- a new MetricData wih a
MetricDataType.LONG_SUM
type.
-
createDoubleSummary
static MetricData createDoubleSummary(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, SummaryData data) Returns a new MetricData wih aMetricDataType.SUMMARY
type.- Returns:
- a new MetricData wih a
MetricDataType.SUMMARY
type.
-
createDoubleHistogram
static MetricData createDoubleHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, HistogramData data) Returns a new MetricData with aMetricDataType.HISTOGRAM
type.- Returns:
- a new MetricData wih a
MetricDataType.HISTOGRAM
type.
-
createExponentialHistogram
static MetricData createExponentialHistogram(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, io.opentelemetry.sdk.metrics.internal.data.exponentialhistogram.ExponentialHistogramData data) Returns a new MetricData with aMetricDataType.EXPONENTIAL_HISTOGRAM
type.- Returns:
- a new MetricData wih a
MetricDataType.EXPONENTIAL_HISTOGRAM
type.
-
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 theMeter
which created theInstrument
that 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()Returnstrue
if there are no points associated with this metric.- Returns:
true
if there are no points associated with this metric.
-
getDoubleGaugeData
Returns theDoubleGaugeData
if type isMetricDataType.DOUBLE_GAUGE
, otherwise a default empty data.- Returns:
- the
DoubleGaugeData
if type isMetricDataType.DOUBLE_GAUGE
, otherwise a default empty data.
-
getLongGaugeData
Returns theLongGaugeData
if type isMetricDataType.LONG_GAUGE
, otherwise a default empty data.- Returns:
- the
LongGaugeData
if type isMetricDataType.LONG_GAUGE
, otherwise a default empty data.
-
getDoubleSumData
Returns theDoubleSumData
if type isMetricDataType.DOUBLE_SUM
, otherwise a default empty data.- Returns:
- the
DoubleSumData
if type isMetricDataType.DOUBLE_SUM
, otherwise a default empty data.
-
getLongSumData
Returns theLongSumData
if type isMetricDataType.LONG_SUM
, otherwise a default empty data.- Returns:
- the
LongSumData
if type isMetricDataType.LONG_SUM
, otherwise a default empty data.
-
getSummaryData
Returns theDoubleSummaryData
if type isMetricDataType.SUMMARY
, otherwise a default empty data.- Returns:
- the
DoubleSummaryData
if type isMetricDataType.SUMMARY
, otherwise a default * empty data.
-
getHistogramData
Returns theDoubleHistogramData
if type isMetricDataType.HISTOGRAM
, otherwise a default empty data.- Returns:
- the
DoubleHistogramData
if type isMetricDataType.HISTOGRAM
, otherwise a default empty data.
-