From 1d89bee8de23127f52435e57ac219c43118050bf Mon Sep 17 00:00:00 2001 From: Amir Mujacic Date: Wed, 26 Nov 2025 10:55:42 +0100 Subject: [PATCH] feat(playstation): Remove prospero dumps from envelope based on project config --- relay-dynamic-config/src/project.rs | 20 +++++++++++++++++++ .../src/services/processor/playstation.rs | 12 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/relay-dynamic-config/src/project.rs b/relay-dynamic-config/src/project.rs index 690a9ab904c..7036f453f39 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 03bf19b8cf3..ac75d3299f9 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)