@@ -14,11 +14,8 @@ use opentelemetry_sdk::{
1414 metrics:: {
1515 data:: { ResourceMetrics , Temporality } ,
1616 exporter:: PushMetricsExporter ,
17- reader:: {
18- AggregationSelector , DefaultAggregationSelector , DefaultTemporalitySelector ,
19- TemporalitySelector ,
20- } ,
21- Aggregation , InstrumentKind , PeriodicReader , SdkMeterProvider ,
17+ reader:: { DefaultTemporalitySelector , TemporalitySelector } ,
18+ InstrumentKind , PeriodicReader , SdkMeterProvider ,
2219 } ,
2320 runtime:: Runtime ,
2421 Resource ,
@@ -50,7 +47,6 @@ impl OtlpPipeline {
5047 {
5148 OtlpMetricPipeline {
5249 rt,
53- aggregator_selector : None ,
5450 temporality_selector : None ,
5551 exporter_pipeline : NoExporterConfig ( ( ) ) ,
5652 resource : None ,
@@ -82,21 +78,19 @@ impl MetricsExporterBuilder {
8278 pub fn build_metrics_exporter (
8379 self ,
8480 temporality_selector : Box < dyn TemporalitySelector > ,
85- aggregation_selector : Box < dyn AggregationSelector > ,
8681 ) -> Result < MetricsExporter > {
8782 match self {
8883 #[ cfg( feature = "grpc-tonic" ) ]
8984 MetricsExporterBuilder :: Tonic ( builder) => {
90- builder. build_metrics_exporter ( aggregation_selector , temporality_selector)
85+ builder. build_metrics_exporter ( temporality_selector)
9186 }
9287 #[ cfg( feature = "http-proto" ) ]
9388 MetricsExporterBuilder :: Http ( builder) => {
94- builder. build_metrics_exporter ( aggregation_selector , temporality_selector)
89+ builder. build_metrics_exporter ( temporality_selector)
9590 }
9691 #[ cfg( not( any( feature = "http-proto" , feature = "grpc-tonic" ) ) ) ]
9792 MetricsExporterBuilder :: Unconfigured => {
9893 drop ( temporality_selector) ;
99- drop ( aggregation_selector) ;
10094 Err ( opentelemetry:: metrics:: MetricsError :: Other (
10195 "no configured metrics exporter, enable `http-proto` or `grpc-tonic` feature to configure a metrics exporter" . into ( ) ,
10296 ) )
@@ -125,7 +119,6 @@ impl From<HttpExporterBuilder> for MetricsExporterBuilder {
125119/// runtime.
126120pub struct OtlpMetricPipeline < RT , EB > {
127121 rt : RT ,
128- aggregator_selector : Option < Box < dyn AggregationSelector > > ,
129122 temporality_selector : Option < Box < dyn TemporalitySelector > > ,
130123 exporter_pipeline : EB ,
131124 resource : Option < Resource > ,
@@ -178,14 +171,6 @@ where
178171 pub fn with_delta_temporality ( self ) -> Self {
179172 self . with_temporality_selector ( DeltaTemporalitySelector )
180173 }
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- }
189174}
190175
191176impl < RT > OtlpMetricPipeline < RT , NoExporterConfig >
@@ -200,7 +185,6 @@ where
200185 OtlpMetricPipeline {
201186 exporter_pipeline : pipeline. into ( ) ,
202187 rt : self . rt ,
203- aggregator_selector : self . aggregator_selector ,
204188 temporality_selector : self . temporality_selector ,
205189 resource : self . resource ,
206190 period : self . period ,
@@ -218,8 +202,6 @@ where
218202 let exporter = self . exporter_pipeline . build_metrics_exporter (
219203 self . temporality_selector
220204 . unwrap_or_else ( || Box :: new ( DefaultTemporalitySelector :: new ( ) ) ) ,
221- self . aggregator_selector
222- . unwrap_or_else ( || Box :: new ( DefaultAggregationSelector :: new ( ) ) ) ,
223205 ) ?;
224206
225207 let mut builder = PeriodicReader :: builder ( exporter, self . rt ) ;
@@ -295,7 +277,6 @@ pub trait MetricsClient: fmt::Debug + Send + Sync + 'static {
295277pub struct MetricsExporter {
296278 client : Box < dyn MetricsClient > ,
297279 temporality_selector : Box < dyn TemporalitySelector > ,
298- aggregation_selector : Box < dyn AggregationSelector > ,
299280}
300281
301282impl Debug for MetricsExporter {
@@ -310,12 +291,6 @@ impl TemporalitySelector for MetricsExporter {
310291 }
311292}
312293
313- impl AggregationSelector for MetricsExporter {
314- fn aggregation ( & self , kind : InstrumentKind ) -> Aggregation {
315- self . aggregation_selector . aggregation ( kind)
316- }
317- }
318-
319294#[ async_trait]
320295impl PushMetricsExporter for MetricsExporter {
321296 async fn export ( & self , metrics : & mut ResourceMetrics ) -> Result < ( ) > {
@@ -337,12 +312,10 @@ impl MetricsExporter {
337312 pub fn new (
338313 client : impl MetricsClient ,
339314 temporality_selector : Box < dyn TemporalitySelector > ,
340- aggregation_selector : Box < dyn AggregationSelector > ,
341315 ) -> MetricsExporter {
342316 MetricsExporter {
343317 client : Box :: new ( client) ,
344318 temporality_selector,
345- aggregation_selector,
346319 }
347320 }
348321}
0 commit comments