Skip to content

Sentry: Improve metadata collection #4115

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 2 commits into from
Nov 3, 2021
Merged

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Nov 2, 2021

The request.id tag and the "custom metadata" are currently only assigned to the Sentry scope in the after() method of the LogRequest middleware. This means that for any manual sentry::capture_exception() call these fields will not be set correctly.

This PR moves the configure_scope() calls into the before() method and add_custom_metadata() function instead. This allows us to send the fields to Sentry for error reports as soon as they are available.

…o `add_custom_metadata()`

This allows us to add the metadata to issue reports as soon as possible, instead of only doing it in the `after()` method of the middleware.
…before()` method

This allows us to add the metadata to issue reports as soon as possible, instead of only doing it in the `after()` method of the middleware.
@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Nov 2, 2021
@Turbo87 Turbo87 requested review from locks and JohnTitor November 2, 2021 11:41
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 3, 2021

📌 Commit a2945a4 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Nov 3, 2021

⌛ Testing commit a2945a4 with merge b13a645...

@bors
Copy link
Contributor

bors commented Nov 3, 2021

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing b13a645 to master...

@bors bors merged commit b13a645 into rust-lang:master Nov 3, 2021
@Turbo87 Turbo87 deleted the sentry-metadata branch November 3, 2021 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants