Skip to content

Commit

Permalink
fix: Ensure namespaces are only matched on metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-auer committed Mar 27, 2024
1 parent cc18860 commit 094a864
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion relay-quotas/src/rate_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::fmt;
use std::str::FromStr;
use std::time::{Duration, Instant};

use relay_base_schema::data_category::DataCategory;
use relay_base_schema::metrics::MetricNamespace;
use relay_base_schema::project::{ProjectId, ProjectKey};
use smallvec::SmallVec;
Expand Down Expand Up @@ -182,7 +183,7 @@ impl RateLimit {

/// Returns `true` if the rate limit namespace matches the namespace of the item.
fn matches_namespace(&self, scoping: ItemScoping<'_>) -> bool {
if self.namespace.is_empty() {
if self.namespace.is_empty() || scoping.category != DataCategory::MetricBucket {
true
} else if let Some(namespace) = scoping.namespace {
self.namespace.contains(&namespace)
Expand Down

0 comments on commit 094a864

Please sign in to comment.