diff --git a/relay-server/src/envelope.rs b/relay-server/src/envelope.rs index 41e2fde862..4a9eee87c4 100644 --- a/relay-server/src/envelope.rs +++ b/relay-server/src/envelope.rs @@ -119,7 +119,7 @@ pub enum ItemType { CheckIn, /// A standalone span. Span, - /// A standalone OpenTelemetry span. + /// A standalone OpenTelemetry span serialized as JSON. OtelSpan, /// An OTLP TracesData container. OtelTracesData, diff --git a/relay-server/src/services/processor/span.rs b/relay-server/src/services/processor/span.rs index cabe0a57d8..c9eb9038fa 100644 --- a/relay-server/src/services/processor/span.rs +++ b/relay-server/src/services/processor/span.rs @@ -79,12 +79,20 @@ fn track_invalid(managed_envelope: &mut TypedEnvelope, reason: Discar fn parse_traces_data(item: Item) -> Result { match item.content_type() { - Some(&ContentType::Json) => { - serde_json::from_slice(&item.payload()).map_err(|_| DiscardReason::InvalidJson) - } - Some(&ContentType::Protobuf) => { - TracesData::decode(item.payload()).map_err(|_| DiscardReason::InvalidProtobuf) - } + Some(&ContentType::Json) => serde_json::from_slice(&item.payload()).map_err(|e| { + relay_log::debug!( + error = &e as &dyn std::error::Error, + "Failed to parse traces data as JSON" + ); + DiscardReason::InvalidJson + }), + Some(&ContentType::Protobuf) => TracesData::decode(item.payload()).map_err(|e| { + relay_log::debug!( + error = &e as &dyn std::error::Error, + "Failed to parse traces data as protobuf" + ); + DiscardReason::InvalidProtobuf + }), _ => Err(DiscardReason::ContentType), } }