From c1f31ba52f95538fe7bf5f1faeec2b265e65cb6e Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 19 Mar 2021 09:45:42 -0700 Subject: [PATCH] Move integer/double variation of Exemplar into Exemplar This move is explicitly a nod to the OpenMetrics form of Exemplar, which support a similar oneof form, allowing both integer and gauge values to co-exist in a Exemplar. Signed-off-by: Bogdan Drutu --- opentelemetry/proto/metrics/v1/metrics.proto | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/opentelemetry/proto/metrics/v1/metrics.proto b/opentelemetry/proto/metrics/v1/metrics.proto index a1ec0e7be..ff31dca76 100644 --- a/opentelemetry/proto/metrics/v1/metrics.proto +++ b/opentelemetry/proto/metrics/v1/metrics.proto @@ -376,7 +376,7 @@ message DoubleDataPoint { // (Optional) List of exemplars collected from // measurements that were used to form the data point - repeated DoubleExemplar exemplars = 5; + repeated Exemplar exemplars = 5; } // IntHistogramDataPoint is deprecated; use HistogramDataPoint. @@ -532,7 +532,7 @@ message HistogramDataPoint { // (Optional) List of exemplars collected from // measurements that were used to form the data point - repeated DoubleExemplar exemplars = 8; + repeated Exemplar exemplars = 8; } // SummaryDataPoint is a single data point in a timeseries that describes the @@ -595,6 +595,8 @@ message SummaryDataPoint { // was recorded, for example the span and trace ID of the active span when the // exemplar was recorded. message IntExemplar { + option deprecated = true; + // The set of labels that were filtered out by the aggregator, but recorded // alongside the original measurement. Only labels that were filtered out // by the aggregator should be included @@ -620,11 +622,11 @@ message IntExemplar { bytes trace_id = 5; } -// A representation of an exemplar, which is a sample input double measurement. +// A representation of an exemplar, which is a sample input measurement. // Exemplars also hold information about the environment when the measurement // was recorded, for example the span and trace ID of the active span when the // exemplar was recorded. -message DoubleExemplar { +message Exemplar { // The set of labels that were filtered out by the aggregator, but recorded // alongside the original measurement. Only labels that were filtered out // by the aggregator should be included @@ -636,8 +638,11 @@ message DoubleExemplar { // 1970. fixed64 time_unix_nano = 2; - // Numerical double value of the measurement that was recorded. - double value = 3; + // Numerical value of the measurement that was recorded. + oneof value { + double as_double = 3; + sfixed64 as_int = 7; + } // (Optional) Span ID of the exemplar trace. // span_id may be missing if the measurement is not recorded inside a trace