Skip to content

Commit

Permalink
feat(spans): Copy measurements to segments (#2942)
Browse files Browse the repository at this point in the history
#skip-changelog
  • Loading branch information
phacops authored Jan 15, 2024
1 parent d36b1fa commit 6679607
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions relay-event-schema/src/protocol/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<TraceContext>().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::<ProfileContext>() {
Expand Down

0 comments on commit 6679607

Please sign in to comment.