@@ -4,7 +4,7 @@ use opentelemetry::metrics::{MetricsError, Result};
4
4
use opentelemetry_sdk:: metrics:: {
5
5
data:: { ResourceMetrics , Temporality } ,
6
6
exporter:: PushMetricsExporter ,
7
- reader:: { AggregationSelector , TemporalitySelector } ,
7
+ reader:: { AggregationSelector , DefaultAggregationSelector , TemporalitySelector } ,
8
8
Aggregation , InstrumentKind ,
9
9
} ;
10
10
@@ -37,8 +37,8 @@ impl Default for MetricsExporter {
37
37
}
38
38
39
39
impl TemporalitySelector for MetricsExporter {
40
+ // This is matching OTLP exporters delta.
40
41
fn temporality ( & self , kind : InstrumentKind ) -> Temporality {
41
- // TODO: Implement temporality selection feature
42
42
match kind {
43
43
InstrumentKind :: Counter
44
44
| InstrumentKind :: ObservableCounter
@@ -52,9 +52,10 @@ impl TemporalitySelector for MetricsExporter {
52
52
}
53
53
54
54
impl AggregationSelector for MetricsExporter {
55
- fn aggregation ( & self , _kind : InstrumentKind ) -> Aggregation {
56
- // TODO: Implement aggregation selection feature
57
- Aggregation :: Sum
55
+ // TODO: this should ideally be done at SDK level by default
56
+ // without exporters having to do it.
57
+ fn aggregation ( & self , kind : InstrumentKind ) -> Aggregation {
58
+ DefaultAggregationSelector :: new ( ) . aggregation ( kind)
58
59
}
59
60
}
60
61
0 commit comments