-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Switch error tracking to Sentry #4409
base: master
Are you sure you want to change the base?
Conversation
0ab560e
to
34156fa
Compare
Bundle watch originally failed here with a large bundle size increase. We are in fact making the bundle smaller from 2.91 MB to 2.87 MB (I compared prod vs staging), but Bundlewatch didn't pick it up, because it seems that rollup is smart enough to remove code that won't run at import time when it's guarded by a falsy condition, i.e. the SENTRY_DSN isn't set in CI, so the code that was using Sentry didn't run, so rollup didn't include in the bundle previously. We have now removed the condition and initialize Sentry always (which is fine to do and fails gracefully without DSN). So rollup now doesn't remove the code, and Bundlewatch thus detects the bundle increase. |
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2025-01-17 11:32:16 UTC |
0fe4200
to
fe458c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice to have someone go through this all and make it sane.
There's one other random mention of Bugsnag in the codebase (a comment explaining why some object isn't desctructured) which I think we can also remove.
I think doing some tire kicking over a video call would be a good way to test this. Wanna book me for 15 minutes? 🙂
@@ -0,0 +1,7 @@ | |||
import * as Sentry from "@sentry/react" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have sentry and scope in the filename, I think
e.g.
initSentryAdminSiteClient.ts
initSentryServer.ts
initSentrySite.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the name, because:
instrument
is what is used in Sentry docs, so if you read the docs and then search for such file, you'll easily find all three of them. Scope is in the module path, i.e. the directory name, we don't usually repeat that in nested file names.instrument
is named by what it does, so if we ever want to add instrumentation of something else, we can.- We don't have to change the name, when we change providers. We also don't call files/folders as specific as
mysql
when we don't need to, but ratherdb
.
Manual testing notes.1.This is from trying to add a circular redirect (which is inferrable through the stack trace) but I'm wondering if this is the top-level message given for all the JsonErrors? 2.OOC, what's up with all these different 3.Here's an error from me adding a malformed gdoc. In Bugsnag, I was able to look at the headers and see the user's email in them, but it looks like they're not here in Sentry? Not essential, but it would be nice to have as I often used this information to quickly follow up with authors who might be stuck on something. 4.I wonder if we should add some more DSNs - the fact that errors/crashes from baking and indexing are both under |
admin
project for the admin client and server processesrelease
is theCOMMIT_SHA
of the currently running code - helps with triage and works with GitHub integration for stuff like comments on PRs and other featuresenvironment
is good for filtering issues, we are gonna distinguish between prod and staging from now on. Running Sentry on staging should help us catch issues before they get to prod.logErrorAndMaybeSendToBugsnag
tologErrorAndMaybeCaptureInSentry
warn
wrapper forconsole.warn
JsonError
toError
where it isn't necessaryYou can see various testing issues and new issues from baking etc. from this branch as well as current ones from production in Sentry.
Resolves #4204
Depends on https://github.com/owid/ops/pull/263