Skip to content

Commit

Permalink
fix(cogs): Only attribute rate limit buckets to spans and transaction…
Browse files Browse the repository at this point in the history
… metrics (#3622)

Only spans and transactions are actually rate limited in that stage.
  • Loading branch information
Dav1dde authored May 17, 2024
1 parent d61226f commit 826bfed
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion relay-server/src/services/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,15 @@ impl EnvelopeProcessorService {
EnvelopeProcessor::SubmitClientReports(_) => AppFeature::ClientReports.into(),
#[cfg(feature = "processing")]
EnvelopeProcessor::RateLimitBuckets(v) => {
relay_metrics::cogs::ByCount(v.bucket_limiter.buckets()).into()
relay_metrics::cogs::ByCount(v.bucket_limiter.buckets().filter(|b| {
// Only spans and transactions are actually rate limited at this point.
// Other metrics do not cause costs.
matches!(
b.name.try_namespace(),
Some(MetricNamespace::Spans | MetricNamespace::Transactions)
)
}))
.into()
}
}
}
Expand Down

0 comments on commit 826bfed

Please sign in to comment.