@@ -14,11 +14,8 @@ use opentelemetry_sdk::{
14
14
metrics:: {
15
15
data:: { ResourceMetrics , Temporality } ,
16
16
exporter:: PushMetricsExporter ,
17
- reader:: {
18
- AggregationSelector , DefaultAggregationSelector , DefaultTemporalitySelector ,
19
- TemporalitySelector ,
20
- } ,
21
- Aggregation , InstrumentKind , PeriodicReader , SdkMeterProvider ,
17
+ reader:: { DefaultTemporalitySelector , TemporalitySelector } ,
18
+ InstrumentKind , PeriodicReader , SdkMeterProvider ,
22
19
} ,
23
20
runtime:: Runtime ,
24
21
Resource ,
@@ -50,7 +47,6 @@ impl OtlpPipeline {
50
47
{
51
48
OtlpMetricPipeline {
52
49
rt,
53
- aggregator_selector : None ,
54
50
temporality_selector : None ,
55
51
exporter_pipeline : NoExporterConfig ( ( ) ) ,
56
52
resource : None ,
@@ -82,21 +78,19 @@ impl MetricsExporterBuilder {
82
78
pub fn build_metrics_exporter (
83
79
self ,
84
80
temporality_selector : Box < dyn TemporalitySelector > ,
85
- aggregation_selector : Box < dyn AggregationSelector > ,
86
81
) -> Result < MetricsExporter > {
87
82
match self {
88
83
#[ cfg( feature = "grpc-tonic" ) ]
89
84
MetricsExporterBuilder :: Tonic ( builder) => {
90
- builder. build_metrics_exporter ( aggregation_selector , temporality_selector)
85
+ builder. build_metrics_exporter ( temporality_selector)
91
86
}
92
87
#[ cfg( feature = "http-proto" ) ]
93
88
MetricsExporterBuilder :: Http ( builder) => {
94
- builder. build_metrics_exporter ( aggregation_selector , temporality_selector)
89
+ builder. build_metrics_exporter ( temporality_selector)
95
90
}
96
91
#[ cfg( not( any( feature = "http-proto" , feature = "grpc-tonic" ) ) ) ]
97
92
MetricsExporterBuilder :: Unconfigured => {
98
93
drop ( temporality_selector) ;
99
- drop ( aggregation_selector) ;
100
94
Err ( opentelemetry:: metrics:: MetricsError :: Other (
101
95
"no configured metrics exporter, enable `http-proto` or `grpc-tonic` feature to configure a metrics exporter" . into ( ) ,
102
96
) )
@@ -125,7 +119,6 @@ impl From<HttpExporterBuilder> for MetricsExporterBuilder {
125
119
/// runtime.
126
120
pub struct OtlpMetricPipeline < RT , EB > {
127
121
rt : RT ,
128
- aggregator_selector : Option < Box < dyn AggregationSelector > > ,
129
122
temporality_selector : Option < Box < dyn TemporalitySelector > > ,
130
123
exporter_pipeline : EB ,
131
124
resource : Option < Resource > ,
@@ -178,14 +171,6 @@ where
178
171
pub fn with_delta_temporality ( self ) -> Self {
179
172
self . with_temporality_selector ( DeltaTemporalitySelector )
180
173
}
181
-
182
- /// Build with the given aggregation selector
183
- pub fn with_aggregation_selector < T : AggregationSelector + ' static > ( self , selector : T ) -> Self {
184
- OtlpMetricPipeline {
185
- aggregator_selector : Some ( Box :: new ( selector) ) ,
186
- ..self
187
- }
188
- }
189
174
}
190
175
191
176
impl < RT > OtlpMetricPipeline < RT , NoExporterConfig >
@@ -200,7 +185,6 @@ where
200
185
OtlpMetricPipeline {
201
186
exporter_pipeline : pipeline. into ( ) ,
202
187
rt : self . rt ,
203
- aggregator_selector : self . aggregator_selector ,
204
188
temporality_selector : self . temporality_selector ,
205
189
resource : self . resource ,
206
190
period : self . period ,
@@ -218,8 +202,6 @@ where
218
202
let exporter = self . exporter_pipeline . build_metrics_exporter (
219
203
self . temporality_selector
220
204
. unwrap_or_else ( || Box :: new ( DefaultTemporalitySelector :: new ( ) ) ) ,
221
- self . aggregator_selector
222
- . unwrap_or_else ( || Box :: new ( DefaultAggregationSelector :: new ( ) ) ) ,
223
205
) ?;
224
206
225
207
let mut builder = PeriodicReader :: builder ( exporter, self . rt ) ;
@@ -295,7 +277,6 @@ pub trait MetricsClient: fmt::Debug + Send + Sync + 'static {
295
277
pub struct MetricsExporter {
296
278
client : Box < dyn MetricsClient > ,
297
279
temporality_selector : Box < dyn TemporalitySelector > ,
298
- aggregation_selector : Box < dyn AggregationSelector > ,
299
280
}
300
281
301
282
impl Debug for MetricsExporter {
@@ -310,12 +291,6 @@ impl TemporalitySelector for MetricsExporter {
310
291
}
311
292
}
312
293
313
- impl AggregationSelector for MetricsExporter {
314
- fn aggregation ( & self , kind : InstrumentKind ) -> Aggregation {
315
- self . aggregation_selector . aggregation ( kind)
316
- }
317
- }
318
-
319
294
#[ async_trait]
320
295
impl PushMetricsExporter for MetricsExporter {
321
296
async fn export ( & self , metrics : & mut ResourceMetrics ) -> Result < ( ) > {
@@ -337,12 +312,10 @@ impl MetricsExporter {
337
312
pub fn new (
338
313
client : impl MetricsClient ,
339
314
temporality_selector : Box < dyn TemporalitySelector > ,
340
- aggregation_selector : Box < dyn AggregationSelector > ,
341
315
) -> MetricsExporter {
342
316
MetricsExporter {
343
317
client : Box :: new ( client) ,
344
318
temporality_selector,
345
- aggregation_selector,
346
319
}
347
320
}
348
321
}
0 commit comments