Skip to content
Draft
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
20 changes: 20 additions & 0 deletions relay-dynamic-config/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -96,6 +112,9 @@ pub struct ProjectConfig {
/// Configuration for metrics.
#[serde(default, skip_serializing_if = "skip_metrics")]
pub metrics: ErrorBoundary<Metrics>,
/// PlayStation-specific configuration.
#[serde(default, skip_serializing_if = "PlaystationConfig::is_empty")]
pub playstation_config: PlaystationConfig,
}

impl ProjectConfig {
Expand Down Expand Up @@ -160,6 +179,7 @@ impl Default for ProjectConfig {
tx_name_ready: false,
span_description_rules: None,
metrics: Default::default(),
playstation_config: PlaystationConfig::default(),
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions relay-server/src/services/processor/playstation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading