Skip to content

Commit

Permalink
fix(server): Disallow static mode for processing (#4087)
Browse files Browse the repository at this point in the history
We only support processing in managed mode, so we should make it a hard
requirement for starting Relay.

Static and proxy mode only exists to put a proxy close to the SDKs in
order to reduce latency and/or provide PII-scrubbing on premise before
sending data to sentry. From [Sentry's product
docs](https://docs.sentry.io/product/relay/):

> Sentry Relay offers enterprise-grade data security by providing a
standalone service that acts as a middle layer between your application
and sentry.io.

These modes were never intended to run in combination with `processing:
true`, and doing so resulted in undefined behavior.
  • Loading branch information
jjbayer authored Sep 30, 2024
1 parent b5c6d81 commit 466cf9b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

**Breaking Changes:**

- Only allow processing enabled in managed mode. ([#4087](https://github.com/getsentry/relay/pull/4087))

**Bug Fixes**:

- Report invalid spans with appropriate outcome reason. ([#4051](https://github.com/getsentry/relay/pull/4051))
Expand Down
4 changes: 2 additions & 2 deletions relay/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ pub fn check_config(config: &Config) -> Result<()> {
);
}

if config.relay_mode() == RelayMode::Proxy && config.processing_enabled() {
anyhow::bail!("Processing cannot be enabled while in proxy mode.");
if config.relay_mode() != RelayMode::Managed && config.processing_enabled() {
anyhow::bail!("Processing can only be enabled in managed mode.");
}

#[cfg(feature = "processing")]
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_readiness_not_enough_memory_bytes(mini_sentry, relay):
)

response = wait_get(relay, "/api/relay/healthcheck/ready/")
time.sleep(0.3) # Wait for error
time.sleep(0.5) # Wait for error
error = str(mini_sentry.test_failures.pop(0))
assert "Not enough memory" in error and ">= 42" in error
error = str(mini_sentry.test_failures.pop(0))
Expand Down

0 comments on commit 466cf9b

Please sign in to comment.