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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetricData.AggregationTemporalityAn enumeration which describes the time period over which metrics should be aggregated.static classMetricData.DoubleGaugeDatastatic classMetricData.DoublePointDoublePoint is a single data point in a timeseries that describes the time-varying value of a double metric.static classMetricData.DoubleSumDatastatic classMetricData.DoubleSummaryDatastatic classMetricData.DoubleSummaryPointSummaryPoint is a single data point that summarizes the values in a time series of numeric values.static classMetricData.LongGaugeDatastatic classMetricData.LongPointLongPoint is a single data point in a timeseries that describes the time-varying values of a int64 metric.static classMetricData.LongSumDatastatic classMetricData.Pointstatic classMetricData.TypeThe kind of metric.static classMetricData.ValueAtPercentile
-
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, MetricData.DoubleGaugeData data)static MetricDatacreateDoubleSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, MetricData.DoubleSumData data)static MetricDatacreateDoubleSummary(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, MetricData.DoubleSummaryData data)static MetricDatacreateLongGauge(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, MetricData.LongGaugeData data)static MetricDatacreateLongSum(io.opentelemetry.sdk.resources.Resource resource, io.opentelemetry.sdk.common.InstrumentationLibraryInfo instrumentationLibraryInfo, String name, String description, String unit, MetricData.LongSumData data)abstract StringgetDescription()Returns the description of this metric.MetricData.DoubleGaugeDatagetDoubleGaugeData()Returns theDoubleGaugeDataif type isMetricData.Type.DOUBLE_GAUGE, otherwise a default empty data.MetricData.DoubleSumDatagetDoubleSumData()Returns theDoubleSumDataif type isMetricData.Type.DOUBLE_SUM, otherwise a default empty data.MetricData.DoubleSummaryDatagetDoubleSummaryData()Returns theDoubleSummaryDataif type isMetricData.Type.SUMMARY, otherwise a default empty data.abstract io.opentelemetry.sdk.common.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Returns the instrumentation library specified when creating theMeterwhich created theInstrumentthat producesMetricData.MetricData.LongGaugeDatagetLongGaugeData()Returns theLongGaugeDataif type isMetricData.Type.LONG_GAUGE, otherwise a default empty data.MetricData.LongSumDatagetLongSumData()Returns theLongSumDataif type isMetricData.Type.LONG_SUM, otherwise a default empty data.abstract StringgetName()Returns the metric name.Collection<MetricData.Point>getPoints()This method will be removed soon.abstract io.opentelemetry.sdk.resources.ResourcegetResource()Returns the resource of thisMetricData.abstract MetricData.TypegetType()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, 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 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 MetricData.Type 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 MetricData.DoubleGaugeData getDoubleGaugeData()
Returns theDoubleGaugeDataif type isMetricData.Type.DOUBLE_GAUGE, otherwise a default empty data.- Returns:
- the
DoubleGaugeDataif type isMetricData.Type.DOUBLE_GAUGE, otherwise a default empty data.
-
getLongGaugeData
public final MetricData.LongGaugeData getLongGaugeData()
Returns theLongGaugeDataif type isMetricData.Type.LONG_GAUGE, otherwise a default empty data.- Returns:
- the
LongGaugeDataif type isMetricData.Type.LONG_GAUGE, otherwise a default empty data.
-
getDoubleSumData
public final MetricData.DoubleSumData getDoubleSumData()
Returns theDoubleSumDataif type isMetricData.Type.DOUBLE_SUM, otherwise a default empty data.- Returns:
- the
DoubleSumDataif type isMetricData.Type.DOUBLE_SUM, otherwise a default empty data.
-
getLongSumData
public final MetricData.LongSumData getLongSumData()
Returns theLongSumDataif type isMetricData.Type.LONG_SUM, otherwise a default empty data.- Returns:
- the
LongSumDataif type isMetricData.Type.LONG_SUM, otherwise a default empty data.
-
getDoubleSummaryData
public final MetricData.DoubleSummaryData getDoubleSummaryData()
Returns theDoubleSummaryDataif type isMetricData.Type.SUMMARY, otherwise a default empty data.- Returns:
- the
DoubleSummaryDataif type isMetricData.Type.SUMMARY, otherwise a default * empty data.
-
getPoints
public Collection<MetricData.Point> getPoints()
This method will be removed soon.
-
-