Skip to content

refactor(tracing): remove EventFilter::exception and always attach exception #768

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

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

lcian
Copy link
Member

@lcian lcian commented Apr 10, 2025

Before this change, when capturing something with e.g. tracing::warn!(error = std_dyn_err(&e), "Something went wrong"); the following would happen based on the EventFilter:

  • EventFilter::Exception -> exception_from_event (includes error in the exception field of the Event)
  • EventFilter::Event -> event_from_event (ignores error)
  • EventFilter::Breadcrumb -> breadcrumb_from_event (ignores error)
    So, both Event and Breadcrumb would counterintuitively ignore the field.

With this change:

  • we remove EventFilter::Exception and exception_from_event in favor of EventFilter::Event and event_from_event, which will behave as the old exception_from_event (attaching error, if any)
  • we attach the error field as structured data in breacrumbs. It's attached as a list of errors from the outermost to the innermost, mimicking the way it would be reported in a Sentry issue.

Closes #702

Copy link
Member

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

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

just a heads up that this will be a breaking change.

@lcian lcian merged commit 6401cfc into master Apr 10, 2025
14 checks passed
@lcian lcian deleted the lcian/feat/tracing-attach-errors branch April 10, 2025 16:06
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.

Errors are silently discarded if tracing event gets converted to a message and in breadcrumbs
2 participants