@@ -191,7 +191,6 @@ pub struct Metric {
191
191
/// name of the metric.
192
192
pub name : Option < String > ,
193
193
/// description of the metric, which can be used in documentation.
194
-
195
194
pub description : Option < String > ,
196
195
/// unit in which the metric value is reported. Follows the format
197
196
/// described by <http://unitsofmeasure.org/ucum.html.>
@@ -235,10 +234,8 @@ pub struct Sum {
235
234
pub data_points : Option < Vec < NumberDataPoint > > ,
236
235
/// aggregation_temporality describes if the aggregator reports delta changes
237
236
/// since last report time, or cumulative changes since a fixed start time.
238
-
239
237
pub aggregation_temporality : Option < i32 > ,
240
238
/// If "true" means that the sum is monotonic.
241
-
242
239
pub is_monotonic : Option < bool > ,
243
240
}
244
241
/// Histogram represents the type of a metric that is calculated by aggregating
@@ -250,7 +247,6 @@ pub struct Histogram {
250
247
pub data_points : Option < Vec < HistogramDataPoint > > ,
251
248
/// aggregation_temporality describes if the aggregator reports delta changes
252
249
/// since last report time, or cumulative changes since a fixed start time.
253
-
254
250
pub aggregation_temporality : Option < i32 > ,
255
251
}
256
252
/// ExponentialHistogram represents the type of a metric that is calculated by aggregating
@@ -261,7 +257,6 @@ pub struct ExponentialHistogram {
261
257
pub data_points : Option < Vec < ExponentialHistogramDataPoint > > ,
262
258
/// aggregation_temporality describes if the aggregator reports delta changes
263
259
/// since last report time, or cumulative changes since a fixed start time.
264
-
265
260
pub aggregation_temporality : Option < i32 > ,
266
261
}
267
262
/// Summary metric data are used to convey quantile summaries,
@@ -560,7 +555,7 @@ pub mod summary_data_point {
560
555
fn deserialize_f64_or_nan < ' de , D > ( deserializer : D ) -> Result < Option < f64 > , D :: Error > where D : Deserializer < ' de > ,
561
556
{
562
557
struct StringOrFloatVisitor ;
563
- impl < ' de > serde:: de:: Visitor < ' de > for StringOrFloatVisitor
558
+ impl serde:: de:: Visitor < ' _ > for StringOrFloatVisitor
564
559
{
565
560
type Value = Option < f64 > ;
566
561
fn expecting ( & self , formatter : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result
@@ -617,68 +612,8 @@ pub struct Exemplar {
617
612
/// which they are aggregated.
618
613
#[ repr( i32 ) ]
619
614
pub enum AggregationTemporality {
620
- /// UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
621
615
Unspecified = 0 ,
622
- /// DELTA is an AggregationTemporality for a metric aggregator which reports
623
- /// changes since last report time. Successive metrics contain aggregation of
624
- /// values from continuous and non-overlapping intervals.
625
- ///
626
- /// The values for a DELTA metric are based only on the time interval
627
- /// associated with one measurement cycle. There is no dependency on
628
- /// previous measurements like is the case for CUMULATIVE metrics.
629
- ///
630
- /// For example, consider a system measuring the number of requests that
631
- /// it receives and reports the sum of these requests every second as a
632
- /// DELTA metric:
633
- ///
634
- /// 1. The system starts receiving at time=t_0.
635
- /// 2. A request is received, the system measures 1 request.
636
- /// 3. A request is received, the system measures 1 request.
637
- /// 4. A request is received, the system measures 1 request.
638
- /// 5. The 1 second collection cycle ends. A metric is exported for the
639
- /// number of requests received over the interval of time t_0 to
640
- /// t_0+1 with a value of 3.
641
- /// 6. A request is received, the system measures 1 request.
642
- /// 7. A request is received, the system measures 1 request.
643
- /// 8. The 1 second collection cycle ends. A metric is exported for the
644
- /// number of requests received over the interval of time t_0+1 to
645
- /// t_0+2 with a value of 2.
646
616
Delta = 1 ,
647
- /// CUMULATIVE is an AggregationTemporality for a metric aggregator which
648
- /// reports changes since a fixed start time. This means that current values
649
- /// of a CUMULATIVE metric depend on all previous measurements since the
650
- /// start time. Because of this, the sender is required to retain this state
651
- /// in some form. If this state is lost or invalidated, the CUMULATIVE metric
652
- /// values MUST be reset and a new fixed start time following the last
653
- /// reported measurement time sent MUST be used.
654
- ///
655
- /// For example, consider a system measuring the number of requests that
656
- /// it receives and reports the sum of these requests every second as a
657
- /// CUMULATIVE metric:
658
- ///
659
- /// 1. The system starts receiving at time=t_0.
660
- /// 2. A request is received, the system measures 1 request.
661
- /// 3. A request is received, the system measures 1 request.
662
- /// 4. A request is received, the system measures 1 request.
663
- /// 5. The 1 second collection cycle ends. A metric is exported for the
664
- /// number of requests received over the interval of time t_0 to
665
- /// t_0+1 with a value of 3.
666
- /// 6. A request is received, the system measures 1 request.
667
- /// 7. A request is received, the system measures 1 request.
668
- /// 8. The 1 second collection cycle ends. A metric is exported for the
669
- /// number of requests received over the interval of time t_0 to
670
- /// t_0+2 with a value of 5.
671
- /// 9. The system experiences a fault and loses state.
672
- /// 10. The system recovers and resumes receiving at time=t_1.
673
- /// 11. A request is received, the system measures 1 request.
674
- /// 12. The 1 second collection cycle ends. A metric is exported for the
675
- /// number of requests received over the interval of time t_1 to
676
- /// t_0+1 with a value of 1.
677
- ///
678
- /// Note: Even though, when reporting changes since last report time, using
679
- /// CUMULATIVE is valid, it is not recommended. This may cause problems for
680
- /// systems that do not use start_time to determine when the aggregation
681
- /// value was reset (e.g. Prometheus).
682
617
Cumulative = 2 ,
683
618
}
684
619
impl AggregationTemporality {
0 commit comments