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

misc: fix some sentry captures #16284

Merged
merged 2 commits into from
Jul 16, 2024
Merged

Conversation

woodruffw
Copy link
Member

These were using fingerprint incorrectly;
I've removed their custom scopes and made them
use the top-level APIs instead, since the scope
isn't adding much more.

@woodruffw woodruffw requested a review from a team as a code owner July 15, 2024 19:14
@woodruffw woodruffw self-assigned this Jul 15, 2024
@woodruffw woodruffw requested a review from miketheman July 15, 2024 19:15
Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

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

I'm fine with these, however I wonder if we'll see dual-reporting for the same issue, and thus not need a capture_message() call alongside capture_exception()

@miketheman miketheman added the developer experience Anything that improves the experience for Warehouse devs label Jul 15, 2024
@woodruffw
Copy link
Member Author

I'm fine with these, however I wonder if we'll see dual-reporting for the same issue, and thus not need a capture_message() call alongside capture_exception()

Yeah, I was wondering about that -- if this is too noisy in practice, I can drop it to just the capture_exception 🙂

@miketheman miketheman enabled auto-merge (squash) July 15, 2024 19:20
@di
Copy link
Member

di commented Jul 15, 2024

If capture_exception is properly discerning/grouping between different exceptions, I don't see a reason to use capture_message.

@miketheman miketheman disabled auto-merge July 15, 2024 19:23
@woodruffw
Copy link
Member Author

If capture_exception is properly discerning/grouping between different exceptions, I don't see a reason to use capture_message.

Cool, removing then!

@di
Copy link
Member

di commented Jul 15, 2024

Although... IIRC the reason we were using capture_message is because this wasn't happening? How is capture_exception here any different than just letting the exception raise?

@woodruffw
Copy link
Member Author

Ah, that rings a bell -- yeah, I think the issue here was that some of these exceptions were ValueError and similar, which ended up being hard to distinguish.

I'll push up what I have here, but another option would be to re-introduce fingerprint with correct usage, e.g.:

scope.fingerprint = ["some-distinguishing-key", exc]

@di
Copy link
Member

di commented Jul 15, 2024

What is the problem with the current usage of fingerprint?

@woodruffw
Copy link
Member Author

What is the problem with the current usage of fingerprint?

Apparently fingerprint can't be a scalar, so fingerprint = e wasn't working when e was just an exception:

image

(@miketheman observed this -- maybe it's a recent change in the Sentry API?)

@di
Copy link
Member

di commented Jul 15, 2024

Can't we just do scope.fingerprint = [e]?

@woodruffw
Copy link
Member Author

Can't we just do scope.fingerprint = [e]?

Yep, that's a lot simpler. Sorry, my brain is thoroughly fried -- I've been at a Homebrew hackathon for the last 72 hours 🙂

I'll rework this PR...

@woodruffw
Copy link
Member Author

Gentle ping for merge 🙂

@miketheman miketheman merged commit 48594f2 into pypi:main Jul 16, 2024
17 checks passed
@woodruffw woodruffw deleted the ww/fix-sentry branch July 17, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience Anything that improves the experience for Warehouse devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants