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

Lightly clean up Sentry event logging. #385

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Conversation

sengi
Copy link
Contributor

@sengi sengi commented Aug 20, 2023

We're still quite some way from using the Sentry API as intended, but this at least makes our usage a bit less weird/buggy and more readable.

  • Send events to Sentry asynchronously, instead of blocking.
  • Allow up to 2 s to finish sending events to Sentry on exit.
  • Manage the lifecycle of the sentry.Client, Hub and Scope objects the way we're supposed to, rather than reinitialising Sentry every time we send an event.
  • Remove the unexported methods on our (still somewhat sketchy) ReportableError type; these weren't helping readability.

Relevant docs:

Base automatically changed from sengi/testability to main August 21, 2023 10:51
@theseanything theseanything marked this pull request as ready for review August 28, 2024 15:21
We're still quite some way from using the Sentry API as intended, but
this at least makes our usage a bit less weird/buggy and more readable.

- Send events to Sentry asynchronously, instead of blocking.
- Allow up to 2 s to finish sending events to Sentry on exit.
- Manage the lifecycle of the sentry.Client, Hub and Scope objects the
  way we're supposed to, rather than reinitialising Sentry every time we
  send an event.
- Remove the unexported methods on our (still somewhat sketchy)
  ReportableError type; these weren't helping readability.

Relevant docs:

- https://docs.sentry.io/platforms/go/usage/
- https://docs.sentry.io/platforms/go/enriching-events/scopes/
- https://docs.sentry.io/platforms/go/concurrency/
- https://docs.sentry.io/platforms/go/panics/
- https://docs.sentry.io/platforms/go/guides/http/
- https://github.com/getsentry/sentry-go/blob/master/_examples/http/main.go
@theseanything theseanything merged commit 528a578 into main Aug 28, 2024
4 checks passed
@theseanything theseanything deleted the sengi/sentry-cleanup branch August 28, 2024 15:38
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.

2 participants