-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Sentry Tracing not working for me #567
Comments
This example does have one problem in it, but I doubt it might be causing this. Sentry is incompatible with But to be completely safe, please move the |
Do you have some example code of what you mean? How can I use the async runtime without |
https://docs.rs/tokio/latest/tokio/runtime/index.html has some examples. |
Ait thank you, I am going to try it and get back to you |
This does not work for me, is this how you meant it should look? fn set_up_tracing() {
let tracing_layer =
tracing_subscriber::fmt::layer().with_filter(filter::filter_fn(|metadata| {
vec![Level::INFO, Level::ERROR, Level::WARN].contains(metadata.level())
}));
let sentry_layer = sentry_tracing::layer();
let _ = tracing_subscriber::registry()
.with(tracing_layer)
.with(sentry_layer)
.init();
}
#[tracing::instrument]
fn main() {
dotenv().ok();
let _guard = sentry::init((
"...",
sentry::ClientOptions {
release: sentry::release_name!(),
sample_rate: 1.0,
..Default::default()
},
));
set_up_tracing();
const VERSION: &str = env!("CARGO_PKG_VERSION");
info!("Starting application with version {}", VERSION);
test_sentry();
}
#[tracing::instrument]
fn test_sentry() {
error!("Testing");
} |
This is pretty close to the code we use ourselves: Though we use the What is the output of the tracing log itself? Also, you can pass the As a drive-by review: You are using |
Thank you for the tip, I have fixed it now. When I pass debug to true I get the following output
|
I'm seeing similar behaviour, any updates? |
I am as well. Also confusing is the hello world example in the |
@Swatinem , is this still the case? The official sentry_tracing crate docs use |
@Swatinem any update here? |
We have updated the docs since then. It seems the doc example was valid in the sense that it compiled, but it did not assert that it actually works correctly. Either way, your log output does not show that any event / transaction was captured either. |
I don't know if I missunderstand the documentation for sentry tracing integration but I can not get event capturing to work. This my test code:
This is my
cargo.toml
dependenciesThe panic event is recieved in Sentry but not the "Testing" error. Do anyone know what I am doing wrong?
The text was updated successfully, but these errors were encountered: