File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
boundaries/metadata/internal/infrastructure/mq Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,17 @@ func (e *Event) SubscribeLinkCreated(
4747
4848 go func () {
4949 for msg := range messages {
50- // 1) Extract consumer context created by otelsarama
50+ // 1) Get message context (contains consumer span created by otelsarama)
51+ // otelsarama automatically extracts traceparent from Kafka RecordHeaders
52+ // and creates a consumer span linked to the producer span
5153 msgCtx := msg .Context ()
5254 if msgCtx == nil {
5355 msgCtx = ctx
5456 }
5557
56- // 2) Extract producer span context from Kafka metadata and attach to message context
58+ // 2) Extract trace context from message metadata
59+ // This ensures proper parent-child relationship between producer and consumer spans
60+ // shortwatermill.ExtractTrace handles the complete trace propagation
5761 msgCtx = shortwatermill .ExtractTrace (msgCtx , msg )
5862 msg .SetContext (msgCtx )
5963
You can’t perform that action at this time.
0 commit comments