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

Add ability to capture SpanTraces #401

Closed
wants to merge 1 commit into from

Conversation

joshka
Copy link

@joshka joshka commented Dec 19, 2024

This was inspired by reading a blog post that showed some shortcomings
of thiserror compared to snafu in capturing backtraces.

The approach here captures a SpanTrace created by the tracing-error
crate. https://docs.rs/tracing-error/

Note: this is a fairly mechanical copy of the relevant backtrace methods
for discussion. I have not yet checked whether theres simplifications
that make sense. It also is problematic due to the unstable version of
the tracing crates, so it's doubtful that this should be merged as-is.

My goal with this PR is to start a conversation about how it might work.

Fixes #400

@joshka joshka mentioned this pull request Dec 19, 2024
This was inspired by reading a blog post that showed some shortcomings
of thiserror compared to snafu in capturing backtraces.

The approach here captures a SpanTrace created by the tracing-error
crate. https://docs.rs/tracing-error/

Note: this is a fairly mechanical copy of the relevant backtrace methods
for discussion. I have not yet checked whether theres simplifications
that make sense. It also is problematic due to the unstable version of
the tracing crates, so it's doubtful that this should be merged as-is.

My goal with this PR is to start a conversation about how it might work.

Fixes dtolnay#400
Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, and for linking the blog post and discussion forum in your issue.

I'm happy with people using snafu for this functionality (and more).

@dtolnay dtolnay closed this Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SpanTraces
2 participants