From 562994bff2a598e400b9080be0731ca5ac1f5613 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Tue, 22 May 2018 18:03:10 -0700 Subject: [PATCH] Wrap label values to distinguish between empty-string and unset. (#56) --- opencensus/proto/stats/metrics/metrics.proto | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/opencensus/proto/stats/metrics/metrics.proto b/opencensus/proto/stats/metrics/metrics.proto index 903a046..e44da31 100644 --- a/opencensus/proto/stats/metrics/metrics.proto +++ b/opencensus/proto/stats/metrics/metrics.proto @@ -83,12 +83,11 @@ message MetricDescriptor { // A collection of data points that describes the time-varying values // of a metric. message TimeSeries { - // TODO: Wrap values to distinguish between empty-string and unset. // TODO: Add restrictions for characters that can be used for keys and values. // The set of label values that uniquely identify this timeseries. Apply to all // points. The order of label values must match that of label keys in the // metric descriptor. - repeated string label_values = 1; + repeated LabelValue label_values = 1; // The data points of this timeseries. Point type MUST match the MetricDescriptor.type, so for // a CUMULATIVE type only cumulative_points are present and for a GAUGE type only gauge_points @@ -97,6 +96,13 @@ message TimeSeries { repeated CumulativePoint cumulative_points = 3; } +message LabelValue { + // The value for the label. + string value = 1; + // If false the value field is ignored and considered not set. + bool has_value = 2; +} + // An instantaneous measurement of a value. message GaugePoint { // The moment when this gauge point was recorded.