@@ -167,10 +167,11 @@ impl Processor for TransactionProcessor {
167167 process:: extract_metrics ( work, ctx, SamplingDecision :: Drop ) ?;
168168
169169 let headers = work. headers . clone ( ) ;
170- let mut profile = process:: drop_after_sampling ( work, ctx, outcome) ;
171- if let Some ( profile) = profile. as_mut ( ) {
172- self . limiter . enforce_quotas ( profile, ctx) . await ?;
173- }
170+ let profile = process:: drop_after_sampling ( work, ctx, outcome) ;
171+ let profile = match profile {
172+ Some ( profile) => self . limiter . enforce_quotas ( profile, ctx) . await . ok ( ) ,
173+ None => None ,
174+ } ;
174175
175176 return Ok ( Output {
176177 main : profile. map ( TransactionOutput :: OnlyProfile ) ,
@@ -189,9 +190,8 @@ impl Processor for TransactionProcessor {
189190 let ( indexed, extracted_metrics) =
190191 process:: extract_metrics ( work, ctx, SamplingDecision :: Keep ) ?;
191192
192- let mut indexed = process:: extract_spans ( indexed, ctx, server_sample_rate) ;
193-
194- self . limiter . enforce_quotas ( & mut indexed, ctx) . await ?;
193+ let indexed = process:: extract_spans ( indexed, ctx, server_sample_rate) ;
194+ let indexed = self . limiter . enforce_quotas ( indexed, ctx) . await ?;
195195
196196 if !indexed. flags . fully_normalized {
197197 relay_log:: error!(
@@ -207,7 +207,7 @@ impl Processor for TransactionProcessor {
207207 } ) ;
208208 }
209209
210- self . limiter . enforce_quotas ( & mut work, ctx) . await ?;
210+ let work = self . limiter . enforce_quotas ( work, ctx) . await ?;
211211
212212 Ok ( Output {
213213 main : Some ( TransactionOutput :: Full ( work) ) ,
@@ -367,13 +367,14 @@ impl<T: Counted + AsRef<Annotated<Event>>> Counted for ExpandedTransaction<T> {
367367}
368368
369369impl < T : Counted + AsRef < Annotated < Event > > > RateLimited for Managed < ExpandedTransaction < T > > {
370+ type Output = Self ;
370371 type Error = Error ;
371372
372373 async fn enforce < R > (
373- & mut self ,
374+ mut self ,
374375 mut rate_limiter : R ,
375376 ctx : Context < ' _ > ,
376- ) -> Result < ( ) , Rejected < Self :: Error > >
377+ ) -> Result < Self , Rejected < Self :: Error > >
377378 where
378379 R : RateLimiter ,
379380 {
@@ -446,7 +447,7 @@ impl<T: Counted + AsRef<Annotated<Event>>> RateLimited for Managed<ExpandedTrans
446447 }
447448 }
448449
449- Ok ( ( ) )
450+ Ok ( self )
450451 }
451452}
452453
0 commit comments