From 8dab369f25c3f5c21ed2fa159f6b23143ded5d6e Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Mon, 22 Jun 2026 11:03:11 +0200 Subject: [PATCH 1/2] ref(spans): Gate description inference behind boolean flag --- relay-server/src/processing/spans/integrations/mod.rs | 10 +++++++++- relay-server/src/processing/spans/mod.rs | 5 +++++ relay-server/src/processing/spans/process.rs | 10 +++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/relay-server/src/processing/spans/integrations/mod.rs b/relay-server/src/processing/spans/integrations/mod.rs index 1acd4169649..ead1f2d6db2 100644 --- a/relay-server/src/processing/spans/integrations/mod.rs +++ b/relay-server/src/processing/spans/integrations/mod.rs @@ -50,7 +50,15 @@ pub fn expand( } } - (Settings::default(), result) + let settings = Settings { + infer_ip: false, + infer_user_agent: false, + infer_name: false, + // OTEL spans don't usually have a description, we want to infer it. + infer_description: true, + }; + + (settings, result) } #[derive(Debug, thiserror::Error)] diff --git a/relay-server/src/processing/spans/mod.rs b/relay-server/src/processing/spans/mod.rs index 62090586a2c..8da1ddf6603 100644 --- a/relay-server/src/processing/spans/mod.rs +++ b/relay-server/src/processing/spans/mod.rs @@ -385,6 +385,11 @@ struct Settings { /// for the benefit of standalone spans which need to have a name inferred /// after conversion to V2. infer_name: bool, + /// Whether the description should be inferred. + /// + /// This should only be enabled for V2 (and OTEL) spans sent by SDKs. V1 + /// spans should already have a description. + infer_description: bool, } /// Spans which have been parsed and expanded from their serialized state. diff --git a/relay-server/src/processing/spans/process.rs b/relay-server/src/processing/spans/process.rs index aac135baf96..f28a9917721 100644 --- a/relay-server/src/processing/spans/process.rs +++ b/relay-server/src/processing/spans/process.rs @@ -116,6 +116,8 @@ fn expand_span_container(item: &Item) -> Result<(Settings, ContainerItems Default::default(), @@ -151,6 +153,9 @@ fn expand_legacy_spans( // The inference can't happen during the conversion // because PII scrubbing needs to run first. infer_name: true, + // We don't want to infer descriptions for legacy spans; they + // should already have one. + infer_description: false, }; (settings, spans) @@ -294,7 +299,10 @@ fn normalize_span_derived( if settings.infer_name { eap::normalize_span_name(span); } - eap::normalize_sentry_description(&mut span.attributes, &span.name); + + if settings.infer_description { + eap::normalize_sentry_description(&mut span.attributes, &span.name); + } } // Set a max_bytes value on the root state if it's defined in the project config. From fcbb3583d9cfbad6ca2c9b1d34b8b7aa51609edd Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Mon, 22 Jun 2026 14:47:54 +0200 Subject: [PATCH 2/2] Correctly handle default settings. --- relay-server/src/processing/spans/process.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/relay-server/src/processing/spans/process.rs b/relay-server/src/processing/spans/process.rs index f28a9917721..d35426cd173 100644 --- a/relay-server/src/processing/spans/process.rs +++ b/relay-server/src/processing/spans/process.rs @@ -98,14 +98,21 @@ fn expand_span_container(item: &Item) -> Result<(Settings, ContainerItems Settings::default(), + None => default_settings, // Technically invalid. - Some(0 | 1) => Settings::default(), + Some(0 | 1) => default_settings, Some(2) => Settings { infer_ip: is .and_then(|is| is.infer_ip) @@ -120,10 +127,10 @@ fn expand_span_container(item: &Item) -> Result<(Settings, ContainerItems Default::default(), + Some(_) => default_settings, } }) - .unwrap_or_default(); + .unwrap_or(default_settings); Ok((settings, spans)) }