ensure otel tracing is passed through all event handlers and clients

This commit is contained in:
Mike Mason
2023-07-21 16:12:24 +00:00
parent 4ac8929644
commit c27e50ea0b
9 changed files with 46 additions and 9 deletions

View File

@@ -142,7 +142,9 @@ func (s *Subscriber) processEvent(msg *changeEvent) error {
"event.type", msg.EventType,
)
ctx, span := tracer.Start(context.Background(), "pubsub.receive", trace.WithAttributes(attribute.String("pubsub.subject", msg.SubjectID.String())))
ctx := events.TraceContextFromChangeMessage(context.Background(), msg.ChangeMessage)
ctx, span := tracer.Start(ctx, "pubsub.receive", trace.WithAttributes(attribute.String("pubsub.subject", msg.SubjectID.String())))
defer span.End()