From 6679607d7a1cae403f9cc072ee5d22b4b1b2ae07 Mon Sep 17 00:00:00 2001 From: Pierre Massat Date: Mon, 15 Jan 2024 08:12:13 -0800 Subject: [PATCH] feat(spans): Copy measurements to segments (#2942) #skip-changelog --- relay-event-schema/src/protocol/span.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/relay-event-schema/src/protocol/span.rs b/relay-event-schema/src/protocol/span.rs index 02b5552908..3cc6136f9a 100644 --- a/relay-event-schema/src/protocol/span.rs +++ b/relay-event-schema/src/protocol/span.rs @@ -97,23 +97,24 @@ pub struct Span { impl From<&Event> for Span { fn from(event: &Event) -> Self { let mut span = Self { + _metrics_summary: event._metrics_summary.clone(), description: event.transaction.clone(), is_segment: Some(true).into(), + measurements: event.measurements.clone(), received: event.received.clone(), start_timestamp: event.start_timestamp.clone(), timestamp: event.timestamp.clone(), - _metrics_summary: event._metrics_summary.clone(), ..Default::default() }; if let Some(trace_context) = event.context::().cloned() { span.exclusive_time = trace_context.exclusive_time; span.op = trace_context.op; - span.span_id = trace_context.span_id; span.parent_span_id = trace_context.parent_span_id; - span.trace_id = trace_context.trace_id; - span.segment_id = span.span_id.clone(); // a transaction is a segment + span.segment_id = trace_context.span_id.clone(); // a transaction is a segment + span.span_id = trace_context.span_id; span.status = trace_context.status; + span.trace_id = trace_context.trace_id; } if let Some(profile_context) = event.context::() {