Rust Tracing integration results in panic in application
Steps to Reproduce
- Enabled
traces_sample_rateinClientOptions - Added tracing subscriber using
tracing_subscriber::registry() .with(tracing_subscriber::fmt::layer()) .with(sentry_tracing::layer()) .init(); - Enabled tracing on rust methods through
#[tracing::instrument]
Expected Result
Expected to receive the traces in the console
Actual Result
thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-subscriber-0.3.17/src/util.rs:91:14
failed to set global default subscriber: SetLoggerError(())
Additional Info
Http tracing through sentry-actix is working fine. Wanted to enable tracing at the method level. I am sure this is bug in the docs, missing a step
Assigning to @getsentry/support for routing ⏲️
@szokeasaurusrex Could you take a look at this issue and possibly help us resolve it?
@lizokm, since this is a Rust SDK issue, @loewenheim or @Swatinem would likely know more about this than I do
Thanks @szokeasaurusrex! @loewenheim or @Swatinem if you could take a look, I would really appreciate it!
A duplicate of this issue was also opened in the sentry-rust repo, which I answered and closed: https://github.com/getsentry/sentry-rust/issues/664#issuecomment-2184918953