Class MetricDataPoint
java.lang.Object
io.mishmash.opentelemetry.server.collector.Batch<Flow.Subscriber<? super T>>
io.mishmash.opentelemetry.server.collector.SubscribersBatch<MetricDataPoint>
io.mishmash.opentelemetry.server.collector.MetricDataPoint
Holds the details of an individual OTLP metric data point
received from a client as a
Batch of all subscribers
that are expected to process it.-
Constructor Summary
ConstructorsConstructorDescriptionMetricDataPoint(Batch<MetricDataPoint> parent, io.opentelemetry.context.Context otelContext) Create a new empty metric data point. -
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.proto.metrics.v1.AggregationTemporalityGet the aggregation temporality of this metric - DELTA, CUMULATIVE, etc...longGet the timestamp when the containing OTLP packet was received.Get the unique id of the containing OTLP packet.intGet the sequence number of this datapoint within the containing metric.Get the metric description.Get the message associated with an error in the data.io.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPointGet the exponential histogram details.io.opentelemetry.proto.metrics.v1.NumberDataPointgetGauge()Get the gauge details.io.opentelemetry.proto.metrics.v1.HistogramDataPointGet the histogram details.Get the schema URL of the OpenTelemetry metric.getName()Get the metric name.io.opentelemetry.proto.resource.v1.ResourceGet the OpenTelemetry Resource of this metric.Get the schema URL of the OpenTelemetry Resouce of this metric.io.opentelemetry.proto.common.v1.InstrumentationScopegetScope()Get the OpenTelemetry Scope of this metric.intgetSeqNo()Get the sequence number of this metric within the containing OTLP packet.io.opentelemetry.proto.metrics.v1.NumberDataPointgetSum()Get the number details.io.opentelemetry.proto.metrics.v1.SummaryDataPointGet the summary details.io.opentelemetry.proto.metrics.v1.Metric.DataCasegetType()Get the metric type - GAUGE, HISTOGRAM, etc...getUnit()Get the metric unit of measure.booleanCheck if the metric is monotonic.booleanisValid()Check if this record is valid.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.ExponentialHistogram otelExponentialHistogram, int dpSeqNo, io.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint dp) Set the details of an exponential histogram data point.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Gauge otelGauge, int dpSeqNo, io.opentelemetry.proto.metrics.v1.NumberDataPoint dp) Set the details of a gauge data point.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Histogram otelHistogram, int dpSeqNo, io.opentelemetry.proto.metrics.v1.HistogramDataPoint dp) Set the details of a histogram data point.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Summary otelSummary, int dpSeqNo, io.opentelemetry.proto.metrics.v1.SummaryDataPoint dp) Set the details of a summary data point.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Sum otelSum, int dpSeqNo, io.opentelemetry.proto.metrics.v1.NumberDataPoint dp) Set the details of a number data point.Methods inherited from class io.mishmash.opentelemetry.server.collector.SubscribersBatch
otelCompleteMethods inherited from class io.mishmash.opentelemetry.server.collector.Batch
add, addAll, cancel, complete, completeExceptionally, currentOtelScope, future, getOtelContext, getProcessedElements, isCancelled, isLoaded, setLoaded, setLoadFailed
-
Constructor Details
-
MetricDataPoint
Create a new empty metric data point.- Parameters:
parent- parentBatchotelContext-Contextfor own telemetry
-
-
Method Details
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.ExponentialHistogram otelExponentialHistogram, int dpSeqNo, io.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint dp) Set the details of an exponential histogram data point. Also verifies the data and potentially sets an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceMetric- used to fill-in OpenTelemetry Resource detailsscopeMetric- used to fill-in OpenTelemetry Scope detailsmetric- the metric detailsotelExponentialHistogram- the exponential histogram detailsdpSeqNo- the data point sequence numberdp- the data point itself
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Gauge otelGauge, int dpSeqNo, io.opentelemetry.proto.metrics.v1.NumberDataPoint dp) Set the details of a gauge data point. Also verifies the data and potentially sets an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceMetric- used to fill-in OpenTelemetry Resource detailsscopeMetric- used to fill-in OpenTelemetry Scope detailsmetric- the metric detailsotelGauge- the gauge detailsdpSeqNo- the data point sequence numberdp- the data point itself
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Histogram otelHistogram, int dpSeqNo, io.opentelemetry.proto.metrics.v1.HistogramDataPoint dp) Set the details of a histogram data point. Also verifies the data and potentially sets an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceMetric- used to fill-in OpenTelemetry Resource detailsscopeMetric- used to fill-in OpenTelemetry Scope detailsmetric- the metric detailsotelHistogram- the histogram detailsdpSeqNo- the data point sequence numberdp- the data point itself
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Sum otelSum, int dpSeqNo, io.opentelemetry.proto.metrics.v1.NumberDataPoint dp) Set the details of a number data point. Also verifies the data and potentially sets an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceMetric- used to fill-in OpenTelemetry Resource detailsscopeMetric- used to fill-in OpenTelemetry Scope detailsmetric- the metric detailsotelSum- the sum detailsdpSeqNo- the data point sequence numberdp- the data point itself
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetric, io.opentelemetry.proto.metrics.v1.ScopeMetrics scopeMetric, io.opentelemetry.proto.metrics.v1.Metric metric, io.opentelemetry.proto.metrics.v1.Summary otelSummary, int dpSeqNo, io.opentelemetry.proto.metrics.v1.SummaryDataPoint dp) Set the details of a summary data point. Also verifies the data and potentially sets an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this spanresourceMetric- used to fill-in OpenTelemetry Resource detailsscopeMetric- used to fill-in OpenTelemetry Scope detailsmetric- the metric detailsotelSummary- the summary detailsdpSeqNo- the data point sequence numberdp- the data point itself
-
getBatchTimestamp
public long getBatchTimestamp()Get the timestamp when the containing OTLP packet was received.- Returns:
- the timestamp, in ms
-
getBatchUUID
Get the unique id of the containing OTLP packet.- Returns:
- the UUID
-
getSeqNo
public int getSeqNo()Get the sequence number of this metric within the containing OTLP packet.- Returns:
- the sequence number, zero-based
-
getResource
public io.opentelemetry.proto.resource.v1.Resource getResource()Get the OpenTelemetry Resource of this metric.- Returns:
- the resource details
-
getResourceSchemaUrl
Get the schema URL of the OpenTelemetry Resouce of this metric.- Returns:
- the schema URL
-
getScope
public io.opentelemetry.proto.common.v1.InstrumentationScope getScope()Get the OpenTelemetry Scope of this metric.- Returns:
- the scope details
-
getName
Get the metric name.- Returns:
- the name of this metric
-
getDescription
Get the metric description.- Returns:
- the description of this metric
-
getUnit
Get the metric unit of measure.- Returns:
- the UOM
-
getType
public io.opentelemetry.proto.metrics.v1.Metric.DataCase getType()Get the metric type - GAUGE, HISTOGRAM, etc...- Returns:
- the type
-
getDatapointSeqNo
public int getDatapointSeqNo()Get the sequence number of this datapoint within the containing metric.- Returns:
- the sequence number, zero-based
-
getExponentialHistogram
public io.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint getExponentialHistogram()Get the exponential histogram details.- Returns:
- the details or null if metric is of different type
-
getGauge
public io.opentelemetry.proto.metrics.v1.NumberDataPoint getGauge()Get the gauge details.- Returns:
- the details or null if metric is of different type
-
getHistogram
public io.opentelemetry.proto.metrics.v1.HistogramDataPoint getHistogram()Get the histogram details.- Returns:
- the details or null if metric is of different type
-
getSum
public io.opentelemetry.proto.metrics.v1.NumberDataPoint getSum()Get the number details.- Returns:
- the details or null if metric is of different type
-
getSummary
public io.opentelemetry.proto.metrics.v1.SummaryDataPoint getSummary()Get the summary details.- Returns:
- the details or null if metric is of different type
-
getMetricSchemaUrl
Get the schema URL of the OpenTelemetry metric.- Returns:
- the schema URL
-
getAggregationTemporality
public io.opentelemetry.proto.metrics.v1.AggregationTemporality getAggregationTemporality()Get the aggregation temporality of this metric - DELTA, CUMULATIVE, etc...- Returns:
- the aggregation temporality
-
isMonotonic
public boolean isMonotonic()Check if the metric is monotonic.- Returns:
- true if monotonic
-
isValid
public boolean isValid()Check if this record is valid.- Returns:
- true if data is valid
-
getErrorMessage
Get the message associated with an error in the data.- Returns:
- the error message or null if data is valid
-