File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
relay-event-normalization/src
relay-event-schema/src/protocol/contexts Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1331,10 +1331,10 @@ fn normalize_contexts(
13311331 contexts. 0 . remove ( "reprocessing" ) ;
13321332
13331333 // We need a TraceId to ingest the event into EAP.
1334- // If the event lacks a TraceContext, add a random one .
1334+ // If the event lacks a TraceContext, derive one from the event id .
13351335
13361336 if config. derive_trace_id && !contexts. contains :: < TraceContext > ( ) {
1337- contexts. add ( TraceContext :: random ( event_id) )
1337+ contexts. add ( TraceContext :: from_event_id ( event_id) )
13381338 }
13391339
13401340 for annotated in & mut contexts. 0 . values_mut ( ) {
Original file line number Diff line number Diff line change @@ -332,9 +332,9 @@ pub struct TraceContext {
332332}
333333
334334impl TraceContext {
335- /// Generates a random [`SpanId`] and takes `[ TraceId]` from the event's UUID.
335+ /// Generates a random [`SpanId`] and derives [` TraceId`] from the event's UUID.
336336 /// Leaves all other fields blank.
337- pub fn random ( event_id : Uuid ) -> Self {
337+ pub fn from_event_id ( event_id : Uuid ) -> Self {
338338 let mut trace_meta = Meta :: default ( ) ;
339339 trace_meta. add_remark ( Remark :: new ( RemarkType :: Substituted , "trace_id.missing" ) ) ;
340340
@@ -641,8 +641,8 @@ mod tests {
641641 }
642642
643643 #[ test]
644- fn test_random_trace_context ( ) {
645- let rand_context = TraceContext :: random ( Uuid :: new_v4 ( ) ) ;
644+ fn test_trace_context_from_event_id ( ) {
645+ let rand_context = TraceContext :: from_event_id ( Uuid :: new_v4 ( ) ) ;
646646 assert ! ( rand_context. trace_id. value( ) . is_some( ) ) ;
647647 assert_eq ! (
648648 rand_context
You can’t perform that action at this time.
0 commit comments