sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

Rust Tracing integration results in panic in application

Open hanishgogada opened this issue 1 year ago • 1 comments

Steps to Reproduce

  1. Enabled traces_sample_rate in ClientOptions
  2. Added tracing subscriber using
    tracing_subscriber::registry()
    .with(tracing_subscriber::fmt::layer())
    .with(sentry_tracing::layer())
    .init();
    
  3. 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

hanishgogada avatar Jun 18 '24 15:06 hanishgogada

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Jun 18 '24 15:06 getsantry[bot]

@szokeasaurusrex Could you take a look at this issue and possibly help us resolve it?

lizokm avatar Jul 10 '24 15:07 lizokm

@lizokm, since this is a Rust SDK issue, @loewenheim or @Swatinem would likely know more about this than I do

szokeasaurusrex avatar Jul 10 '24 16:07 szokeasaurusrex

Thanks @szokeasaurusrex! @loewenheim or @Swatinem if you could take a look, I would really appreciate it!

lizokm avatar Jul 10 '24 16:07 lizokm

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

Swatinem avatar Jul 11 '24 07:07 Swatinem