Class Metric
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- io.opentelemetry.proto.metrics.v1.Metric
-
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,MetricOrBuilder,Serializable
public final class Metric extends com.google.protobuf.GeneratedMessageV3 implements MetricOrBuilder
Defines a Metric which has one or more timeseries. The following is a brief summary of the Metric data model. For more details, see: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md The data model and relation between entities is shown in the diagram below. Here, "DataPoint" is the term used to refer to any one of the specific data point value types, and "points" is the term used to refer to any one of the lists of points contained in the Metric. - Metric is composed of a metadata and data. - Metadata part contains a name, description, unit. - Data is one of the possible types (Sum, Gauge, Histogram, Summary). - DataPoint contains timestamps, attributes, and one of the possible value type fields. Metric +------------+ |name | |description | |unit | +------------------------------------+ |data |---> |Gauge, Sum, Histogram, Summary, ... | +------------+ +------------------------------------+ Data [One of Gauge, Sum, Histogram, Summary, ...] +-----------+ |... | // Metadata about the Data. |points |--+ +-----------+ | | +---------------------------+ | |DataPoint 1 | v |+------+------+ +------+ | +-----+ ||label |label |...|label | | | 1 |-->||value1|value2|...|valueN| | +-----+ |+------+------+ +------+ | | . | |+-----+ | | . | ||value| | | . | |+-----+ | | . | +---------------------------+ | . | . | . | . | . | . | . | +---------------------------+ | . | |DataPoint M | +-----+ |+------+------+ +------+ | | M |-->||label |label |...|label | | +-----+ ||value1|value2|...|valueN| | |+------+------+ +------+ | |+-----+ | ||value| | |+-----+ | +---------------------------+ Each distinct type of DataPoint represents the output of a specific aggregation function, the result of applying the DataPoint's associated function of to one or more measurements. All DataPoint types have three common fields: - Attributes includes key-value pairs associated with the data point - TimeUnixNano is required, set to the end time of the aggregation - StartTimeUnixNano is optional, but strongly encouraged for DataPoints having an AggregationTemporality field, as discussed below. Both TimeUnixNano and StartTimeUnixNano values are expressed as UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. # TimeUnixNano This field is required, having consistent interpretation across DataPoint types. TimeUnixNano is the moment corresponding to when the data point's aggregate value was captured. Data points with the 0 value for TimeUnixNano SHOULD be rejected by consumers. # StartTimeUnixNano StartTimeUnixNano in general allows detecting when a sequence of observations is unbroken. This field indicates to consumers the start time for points with cumulative and delta AggregationTemporality, and it should be included whenever possible to support correct rate calculation. Although it may be omitted when the start time is truly unknown, setting StartTimeUnixNano is strongly encouraged.Protobuf typeopentelemetry.proto.metrics.v1.Metric- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMetric.BuilderDefines a Metric which has one or more timeseries.static classMetric.DataCase-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intDESCRIPTION_FIELD_NUMBERstatic intEXPONENTIAL_HISTOGRAM_FIELD_NUMBERstatic intGAUGE_FIELD_NUMBERstatic intHISTOGRAM_FIELD_NUMBERstatic intNAME_FIELD_NUMBERstatic intSUM_FIELD_NUMBERstatic intSUMMARY_FIELD_NUMBERstatic intUNIT_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Metric.DataCasegetDataCase()static MetricgetDefaultInstance()MetricgetDefaultInstanceForType()StringgetDescription()description of the metric, which can be used in documentation.com.google.protobuf.ByteStringgetDescriptionBytes()description of the metric, which can be used in documentation.static com.google.protobuf.Descriptors.DescriptorgetDescriptor()ExponentialHistogramgetExponentialHistogram().opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;ExponentialHistogramOrBuildergetExponentialHistogramOrBuilder().opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;GaugegetGauge().opentelemetry.proto.metrics.v1.Gauge gauge = 5;GaugeOrBuildergetGaugeOrBuilder().opentelemetry.proto.metrics.v1.Gauge gauge = 5;HistogramgetHistogram().opentelemetry.proto.metrics.v1.Histogram histogram = 9;HistogramOrBuildergetHistogramOrBuilder().opentelemetry.proto.metrics.v1.Histogram histogram = 9;StringgetName()name of the metric, including its DNS name prefix.com.google.protobuf.ByteStringgetNameBytes()name of the metric, including its DNS name prefix.com.google.protobuf.Parser<Metric>getParserForType()intgetSerializedSize()SumgetSum().opentelemetry.proto.metrics.v1.Sum sum = 7;SummarygetSummary().opentelemetry.proto.metrics.v1.Summary summary = 11;SummaryOrBuildergetSummaryOrBuilder().opentelemetry.proto.metrics.v1.Summary summary = 11;SumOrBuildergetSumOrBuilder().opentelemetry.proto.metrics.v1.Sum sum = 7;StringgetUnit()unit in which the metric value is reported.com.google.protobuf.ByteStringgetUnitBytes()unit in which the metric value is reported.com.google.protobuf.UnknownFieldSetgetUnknownFields()booleanhasExponentialHistogram().opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;booleanhasGauge().opentelemetry.proto.metrics.v1.Gauge gauge = 5;inthashCode()booleanhasHistogram().opentelemetry.proto.metrics.v1.Histogram histogram = 9;booleanhasSum().opentelemetry.proto.metrics.v1.Sum sum = 7;booleanhasSummary().opentelemetry.proto.metrics.v1.Summary summary = 11;protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static Metric.BuildernewBuilder()static Metric.BuildernewBuilder(Metric prototype)Metric.BuildernewBuilderForType()protected Metric.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static MetricparseDelimitedFrom(InputStream input)static MetricparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MetricparseFrom(byte[] data)static MetricparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MetricparseFrom(com.google.protobuf.ByteString data)static MetricparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MetricparseFrom(com.google.protobuf.CodedInputStream input)static MetricparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MetricparseFrom(InputStream input)static MetricparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static MetricparseFrom(ByteBuffer data)static MetricparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<Metric>parser()Metric.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DESCRIPTION_FIELD_NUMBER
public static final int DESCRIPTION_FIELD_NUMBER
- See Also:
- Constant Field Values
-
UNIT_FIELD_NUMBER
public static final int UNIT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
GAUGE_FIELD_NUMBER
public static final int GAUGE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
SUM_FIELD_NUMBER
public static final int SUM_FIELD_NUMBER
- See Also:
- Constant Field Values
-
HISTOGRAM_FIELD_NUMBER
public static final int HISTOGRAM_FIELD_NUMBER
- See Also:
- Constant Field Values
-
EXPONENTIAL_HISTOGRAM_FIELD_NUMBER
public static final int EXPONENTIAL_HISTOGRAM_FIELD_NUMBER
- See Also:
- Constant Field Values
-
SUMMARY_FIELD_NUMBER
public static final int SUMMARY_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getDataCase
public Metric.DataCase getDataCase()
- Specified by:
getDataCasein interfaceMetricOrBuilder
-
getName
public String getName()
name of the metric, including its DNS name prefix. It must be unique.
string name = 1;- Specified by:
getNamein interfaceMetricOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()
name of the metric, including its DNS name prefix. It must be unique.
string name = 1;- Specified by:
getNameBytesin interfaceMetricOrBuilder- Returns:
- The bytes for name.
-
getDescription
public String getDescription()
description of the metric, which can be used in documentation.
string description = 2;- Specified by:
getDescriptionin interfaceMetricOrBuilder- Returns:
- The description.
-
getDescriptionBytes
public com.google.protobuf.ByteString getDescriptionBytes()
description of the metric, which can be used in documentation.
string description = 2;- Specified by:
getDescriptionBytesin interfaceMetricOrBuilder- Returns:
- The bytes for description.
-
getUnit
public String getUnit()
unit in which the metric value is reported. Follows the format described by http://unitsofmeasure.org/ucum.html.
string unit = 3;- Specified by:
getUnitin interfaceMetricOrBuilder- Returns:
- The unit.
-
getUnitBytes
public com.google.protobuf.ByteString getUnitBytes()
unit in which the metric value is reported. Follows the format described by http://unitsofmeasure.org/ucum.html.
string unit = 3;- Specified by:
getUnitBytesin interfaceMetricOrBuilder- Returns:
- The bytes for unit.
-
hasGauge
public boolean hasGauge()
.opentelemetry.proto.metrics.v1.Gauge gauge = 5;- Specified by:
hasGaugein interfaceMetricOrBuilder- Returns:
- Whether the gauge field is set.
-
getGauge
public Gauge getGauge()
.opentelemetry.proto.metrics.v1.Gauge gauge = 5;- Specified by:
getGaugein interfaceMetricOrBuilder- Returns:
- The gauge.
-
getGaugeOrBuilder
public GaugeOrBuilder getGaugeOrBuilder()
.opentelemetry.proto.metrics.v1.Gauge gauge = 5;- Specified by:
getGaugeOrBuilderin interfaceMetricOrBuilder
-
hasSum
public boolean hasSum()
.opentelemetry.proto.metrics.v1.Sum sum = 7;- Specified by:
hasSumin interfaceMetricOrBuilder- Returns:
- Whether the sum field is set.
-
getSum
public Sum getSum()
.opentelemetry.proto.metrics.v1.Sum sum = 7;- Specified by:
getSumin interfaceMetricOrBuilder- Returns:
- The sum.
-
getSumOrBuilder
public SumOrBuilder getSumOrBuilder()
.opentelemetry.proto.metrics.v1.Sum sum = 7;- Specified by:
getSumOrBuilderin interfaceMetricOrBuilder
-
hasHistogram
public boolean hasHistogram()
.opentelemetry.proto.metrics.v1.Histogram histogram = 9;- Specified by:
hasHistogramin interfaceMetricOrBuilder- Returns:
- Whether the histogram field is set.
-
getHistogram
public Histogram getHistogram()
.opentelemetry.proto.metrics.v1.Histogram histogram = 9;- Specified by:
getHistogramin interfaceMetricOrBuilder- Returns:
- The histogram.
-
getHistogramOrBuilder
public HistogramOrBuilder getHistogramOrBuilder()
.opentelemetry.proto.metrics.v1.Histogram histogram = 9;- Specified by:
getHistogramOrBuilderin interfaceMetricOrBuilder
-
hasExponentialHistogram
public boolean hasExponentialHistogram()
.opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;- Specified by:
hasExponentialHistogramin interfaceMetricOrBuilder- Returns:
- Whether the exponentialHistogram field is set.
-
getExponentialHistogram
public ExponentialHistogram getExponentialHistogram()
.opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;- Specified by:
getExponentialHistogramin interfaceMetricOrBuilder- Returns:
- The exponentialHistogram.
-
getExponentialHistogramOrBuilder
public ExponentialHistogramOrBuilder getExponentialHistogramOrBuilder()
.opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10;- Specified by:
getExponentialHistogramOrBuilderin interfaceMetricOrBuilder
-
hasSummary
public boolean hasSummary()
.opentelemetry.proto.metrics.v1.Summary summary = 11;- Specified by:
hasSummaryin interfaceMetricOrBuilder- Returns:
- Whether the summary field is set.
-
getSummary
public Summary getSummary()
.opentelemetry.proto.metrics.v1.Summary summary = 11;- Specified by:
getSummaryin interfaceMetricOrBuilder- Returns:
- The summary.
-
getSummaryOrBuilder
public SummaryOrBuilder getSummaryOrBuilder()
.opentelemetry.proto.metrics.v1.Summary summary = 11;- Specified by:
getSummaryOrBuilderin interfaceMetricOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Metric parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Metric parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static Metric parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static Metric parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static Metric parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static Metric parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static Metric parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public Metric.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static Metric.Builder newBuilder()
-
newBuilder
public static Metric.Builder newBuilder(Metric prototype)
-
toBuilder
public Metric.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Metric.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static Metric getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<Metric> parser()
-
getParserForType
public com.google.protobuf.Parser<Metric> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public Metric getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-