Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Add `http.request.header.cookie` to fields scrubbed by cookie rules. ([#5408](https://github.com/getsentry/relay/pull/5408))
- Map `request_id` to `trace_id` in vercel log drain transform. ([#5333](https://github.com/getsentry/relay/pull/5333))
- Populate `sentry.platform` during OTLP ingestion. ([#5411](https://github.com/getsentry/relay/pull/5411))
- Implement optional opportunistic caching for quotas. ([#5416](https://github.com/getsentry/relay/pull/5416))
- Add db attribute normalization to V2 spans. ([#5399](https://github.com/getsentry/relay/pull/5399))

**Internal**:
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,13 @@ pub struct Processing {
/// Maximum rate limit to report to clients.
#[serde(default = "default_max_rate_limit")]
pub max_rate_limit: Option<u32>,
/// Configures the quota cache.
///
/// The quota cache, caches the specified percentage of remaining quota in memory to reduce the
/// amount of synchronizations required with Redis.
///
/// By default quota caching is disabled.
pub quota_cache_percentage: Option<f32>,
/// Configuration for attachment uploads.
#[serde(default)]
pub upload: UploadServiceConfig,
Expand All @@ -1214,6 +1221,7 @@ impl Default for Processing {
attachment_chunk_size: default_chunk_size(),
projectconfig_cache_prefix: default_projectconfig_cache_prefix(),
max_rate_limit: default_max_rate_limit(),
quota_cache_percentage: None,
upload: UploadServiceConfig::default(),
}
}
Expand Down Expand Up @@ -2601,6 +2609,11 @@ impl Config {
self.values.processing.max_rate_limit.map(u32::into)
}

/// Amount of remaining quota which is cached in memory.
pub fn quota_cache_percentage(&self) -> Option<f32> {
self.values.processing.quota_cache_percentage
}

/// Cache vacuum interval for the cardinality limiter in memory cache.
///
/// The cache will scan for expired values based on this interval.
Expand Down
2 changes: 2 additions & 0 deletions relay-quotas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ workspace = true
[dependencies]
async-trait = { workspace = true }
hashbrown = { workspace = true }
papaya = { workspace = true }
itertools = { workspace = true }
relay-base-schema = { workspace = true }
relay-common = { workspace = true }
relay-log = { workspace = true, optional = true }
relay-redis = { workspace = true, optional = true }
relay-statsd = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
thiserror = { workspace = true, optional = true }
Expand Down
Loading
Loading