Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom extraction/injection of Sentry otel baggage #2264

Closed
jscheid opened this issue Mar 13, 2024 · 4 comments
Closed

Custom extraction/injection of Sentry otel baggage #2264

jscheid opened this issue Mar 13, 2024 · 4 comments
Assignees
Labels

Comments

@jscheid
Copy link

jscheid commented Mar 13, 2024

I'd like to use Sentry::OpenTelemetry::Propagator to extract baggage from, and inject baggage into, carriers other than HTTP headers. I seem to have this working for extraction, but when I try to re-inject the baggage into a fresh carrier it doesn't seem to work, nothing is added to the carrier.

I've tried both with and without creating a new span inside the extracted context, please see this test case:

https://gist.github.com/jscheid/9b685ebaaa0ab088c36a66059c33694f

This is probably due to faulty assumptions on my part -- can you spot what's wrong with my code?

@jscheid
Copy link
Author

jscheid commented Mar 13, 2024

I'm fairly sure that this is caused by Sentry.start_transaction returning nil here. I'll try to work out why, or perhaps you can provide any clues?

@jscheid
Copy link
Author

jscheid commented Mar 13, 2024

Sorry, this was due to a misconfiguration.

@jscheid jscheid closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
@sl0thentr0py
Copy link
Member

oh i was about to investigate, but glad you figured it out!
Can you also write briefly what the problem/fix was so that other people who land on this issue have a reference?

@jscheid
Copy link
Author

jscheid commented Mar 13, 2024

Sentry::OpenTelemetry::Propagator.inject doesn't do anything (for imported contexts) unless Sentry.configuration.tracing_enabled? returns truthy, even if called explicitly like in my example. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants