diff --git a/relay-dynamic-config/src/project.rs b/relay-dynamic-config/src/project.rs index 690a9ab904..7036f453f3 100644 --- a/relay-dynamic-config/src/project.rs +++ b/relay-dynamic-config/src/project.rs @@ -19,6 +19,22 @@ use crate::metrics::{ use crate::trusted_relay::TrustedRelayConfig; use crate::{GRADUATED_FEATURE_FLAGS, defaults}; +/// PlayStation-specific configuration. +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[serde(default, rename_all = "camelCase")] +pub struct PlaystationConfig { + /// Whether to store the prosperodump as an attachment after processing. + /// When false, the prosperodump is still used for symbolication but not stored. + #[serde(default)] + pub store_prosperodump: bool, +} + +impl PlaystationConfig { + fn is_empty(&self) -> bool { + !self.store_prosperodump + } +} + /// Dynamic, per-DSN configuration passed down from Sentry. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(default, rename_all = "camelCase")] @@ -96,6 +112,9 @@ pub struct ProjectConfig { /// Configuration for metrics. #[serde(default, skip_serializing_if = "skip_metrics")] pub metrics: ErrorBoundary, + /// PlayStation-specific configuration. + #[serde(default, skip_serializing_if = "PlaystationConfig::is_empty")] + pub playstation_config: PlaystationConfig, } impl ProjectConfig { @@ -160,6 +179,7 @@ impl Default for ProjectConfig { tx_name_ready: false, span_description_rules: None, metrics: Default::default(), + playstation_config: PlaystationConfig::default(), } } } diff --git a/relay-server/src/services/processor/playstation.rs b/relay-server/src/services/processor/playstation.rs index 03bf19b8cf..ac75d3299f 100644 --- a/relay-server/src/services/processor/playstation.rs +++ b/relay-server/src/services/processor/playstation.rs @@ -97,6 +97,18 @@ pub fn process( } merge_playstation_context(event, &prospero_dump); + // Remove the prosperodump attachment if the project is not configured to store it + if !project_info + .config + .playstation_config + .store_prosperodump + { + envelope.retain_items(|item| { + !(item.ty() == &ItemType::Attachment + && item.attachment_type() == Some(&AttachmentType::Prosperodump)) + }); + } + return Ok(Some(EventFullyNormalized(false))); } Ok(None)