@@ -38,10 +38,8 @@ message Metric {
3838 MetricDescriptor metric_descriptor = 1 ;
3939
4040 // One or more timeseries for a single metric, where each timeseries has
41- // one or more points. The type of the timeseries must match
42- // metric_descriptor.type, so only one of the two should be populated.
43- repeated GaugeTimeSeries gauge_timeseries = 2 ;
44- repeated CumulativeTimeSeries cumulative_timeseries = 3 ;
41+ // one or more points.
42+ repeated TimeSeries timeseries = 2 ;
4543}
4644
4745// Defines a metric type and its schema.
@@ -99,29 +97,21 @@ message LabelKey {
9997}
10098
10199// A collection of data points that describes the time-varying values
102- // of a gauge metric.
103- message GaugeTimeSeries {
104- // The set of label values that uniquely identify this timeseries. Applies to
105- // all points. The order of label values must match that of label keys in the
106- // metric descriptor.
107- repeated LabelValue label_values = 1 ;
108-
109- // The data points of this timeseries. Point type MUST match the MetricDescriptor.type.
110- repeated Point points = 2 ;
111- }
112-
113- // A collection of data points that describes the time-varying values
114- // of a cumulative metric.
115- message CumulativeTimeSeries {
116- // The time that the cumulative value was reset to zero.
117- google.protobuf.Timestamp start_time = 1 ; // required
100+ // of a metric.
101+ message TimeSeries {
102+ // Must be present for cumulative metrics. The time when the cumulative value
103+ // was reset to zero. The cumulative value is over the time interval
104+ // [start_timestamp, timestamp]. If not specified, the backend can use the
105+ // previous recorded value.
106+ google.protobuf.Timestamp start_timestamp = 1 ;
118107
119108 // The set of label values that uniquely identify this timeseries. Applies to
120109 // all points. The order of label values must match that of label keys in the
121110 // metric descriptor.
122111 repeated LabelValue label_values = 2 ;
123112
124- // The data points of this timeseries. Point type MUST match the MetricDescriptor.type.
113+ // The data points of this timeseries. Point.value type MUST match the
114+ // MetricDescriptor.type.
125115 repeated Point points = 3 ;
126116}
127117
@@ -135,8 +125,9 @@ message LabelValue {
135125
136126// A timestamped measurement.
137127message Point {
138- // The moment when this point was recorded.
139- google.protobuf.Timestamp timestamp = 1 ; // required
128+ // The moment when this point was recorded. If not specified, the timestamp
129+ // will be decided by the backend.
130+ google.protobuf.Timestamp timestamp = 1 ;
140131
141132 // The actual point value.
142133 oneof value {
0 commit comments