sentry-rust
sentry-rust copied to clipboard
Spans not sent if span is dropped manually or exec is called?
Environment
What version are you running? Etc.
- Environment: SaaS, sentry.io
- OS: macOS (not tested on others)
- Version: 0.32.2,
tracingfeature enabled
Steps to Reproduce
This code is open source, so you can peek through it.
- I've used the
tracing::instrumentmacro to instrument different commands in our CLI. Here's an example of a working command (install command). - For our "activate" command we either print a script for the shell to source, or we
execa user's shell. - Thinking that I didn't want to record time spent inside a user's shell, I thought that rather than using the
instrumentmacro I would create a span manually so that I could drop it at the appropriate time. - I do that here: activate command.
- No spans are sent for this command, unexpectedly.
- In a local checkout I've also tried switching back to the
instrumentmacro in case there's some cleanup that I'm not performing (I also removed the manualdrops), but there are still no spans sent for this command. I'm thinking that somehow a transaction isn't gettingfinished? - I'm able to see the
tracinglogs in my terminal, so theactivatespan is getting created, but it's not getting reported.
Expected Result
I would expect spans to be reported for this command like all the others.
Actual Result
Sentry is initialized:
2024-03-21T21:08:25.972199Z DEBUG flox::utils::init::sentry: Initializing Sentry with DSN: <DSN>
2024-03-21T21:08:25.975892Z DEBUG sentry: enabled sentry client for DSN <DSN>
For commands that do work you later see logs like this:
2024-03-21T21:32:21.223920Z DEBUG sentry: dropping client guard -> disposing client
2024-03-21T21:32:21.224003Z DEBUG sentry: client close; request transport to shut down
...hyper/reqwest logs
2024-03-21T21:32:21.401103Z DEBUG sentry: Get response: `{"id":"1965f0595eba42109a6d6cca86bfb0ad"}`
For this activate command the second set of logs is missing.