[vtadmin-web] Add client-side error handling interface + Bugsnag implementation #8287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sara Bee [email protected]
Description
ErrorHandler
interface for Bugsnag, for deployments that use it.Implementations for other monitoring services (common ones being Sentry, Rollbar, Datadog, etc.) are left as future enhancements. 😸 (I briefly considered implementing one other, to prove the concept, but... it didn't really make sense to add an integration that no one uses!) I looked into the JavaScript libraries for the aforementioned monitoring services and all of them fit nicely into the
ErrorHandler
interface proposed here.Also unimplemented for now + worth mentioning are sourcemaps, which provide proper stack-traces for errors (since our client-side code is minified). "Undocumented" is perhaps a better term than "unimplemented", as source map uploads will (unfortunately) be the responsibility of the operator. I do promise to document how we do it, once we do it. 🙏
Here's an example of what this (specifically, the metadata) looks like in Bugsnag:
And here's what it looks like with the Bugsnag/Slack integration:
Many thanks to David + Anders from PlanetScale for pointing me at https://vitess.io/docs/user-guides/configuration-basic/monitoring/#tools, which was super useful in terms of precedent + documentation!
Related Issue(s)
N/A
Checklist
Deployment Notes
For any deployments that want to integrate VTAdmin with Bugsnag, you'll need to set the
REACT_APP_BUGSNAG_API_KEY
environment variable.