Skip to content

Commit

Permalink
Move integer/double variation of Exemplar into Exemplar
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
bogdandrutu committed Mar 19, 2021
1 parent 860f3a2 commit c1f31ba
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions opentelemetry/proto/metrics/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c1f31ba

Please sign in to comment.