OTEL propagation through pub/sub #2574
Unanswered
NathanBaulch
asked this question in
Q&A
Replies: 1 comment
-
FWIW, this is what I ended up with. https://gist.github.com/NathanBaulch/cf585100454b0afd724ccb6eb70eb334 Notes:
Example usage: ps := redisotel.Subscribe(ctx, rds, "foo")
defer ps.Close()
go func() {
for m := range ps.Channel() {
ctx := m.WithContext(ctx)
handleMessage(ctx, m.Payload)
}
}()
for i := 0; i < 10; i++ {
ps.Publish(ctx, "foo", i)
}
time.Sleep(time.Second) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to see code that responds to a pub/sub subscription message captured in the OTEL span of the publisher. Is this a solved problem or do I need to roll something myself?
I've been tinkering with a
redis.PubSub
wrapper that appends the OTEL state (traceparent
andtracestate
) to the pubsub payload and extracts it out again when a channel message is received. It works, but I'm just wondering if there's an existing solution out there.Beta Was this translation helpful? Give feedback.
All reactions