-
Notifications
You must be signed in to change notification settings - Fork 70
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
Improve production error logging #906
Comments
I would like to take a stab at the desired improvements.
|
Great, can I assign you to this issue then? Just so we know that there's someone already working on it. |
Ya put me on this one |
So the client side error reporting in dev environment is coming from the Lines 20 to 21 in 4e90693
It seems like a lot of these defaults are maybe stale? and should not be hidden in this config file either way. If the user needs them they should explicitly have to set them in there .env file. We can copy the defaults that should be there to our Currently that sentry_dna key is pointing to a seperate dev_sandbox project which I think is nice to have for our engineering team to be able to test out sentry functions on there local machine (ie we should keep it and just move it to the private engineering key list) Something like this: Inspired from: https://12factor.net/config |
Just as an additional information, adding the environment variables on If you want you can remove the sentry values from there when you send a PR for this issue. |
I've got a working setup for my dev environment that is reporting both frontend and backend errors but I'm still working on getting the config setup that will also work on our vercel host. It also appears there maybe some issues with the |
Issue Status ReportThe main issue with the old setup is it only sent backend errors that we manual caught and forwarded with our logger.ts helper middleware utility. This not only caused a lot of errors to go unnoticed it also seems to not be playing well with the vercel serverless functions and muddies up the stack trace with all the logging function calls. This new setup uses the Though it still require the The big bonus of this sentry.io setup is:
Test BranchCreated test PR #922 with a live vercel preview branch hosted here: Test branch includes:
Engineering team can login and view the error reports:
Screenshots for those that don't have login: Changes
To-Do
|
Oh damn that's some awesome stuff. Didn't even know sentry could do all that. Nice work 💪 |
So this issue has snowballed to be much bigger than I initially intended. Since apollo has its own error handler that catches and process the error you have to make an Apollo Plugin that links into there error event handler. Luckily there was a blog post for this that I was basically able to copy paste. Blog: https://blog.sentry.io/2020/07/22/handling-graphql-errors-using-sentry But there is also still an issue with Remaining Todo
|
And flush is not working =/ I feel like I am in a bit of stand still until this sentry serverless fail to flush issue gets solved.
|
Ok so I have a working pr going now! 895bb39 Solution: Manually check if sentry client is running and manually call Concerns: The sentry packages should be doing this for us and maybe currently creating extra errors that they are suppressing. The manual initializing may lead to some performance issues? (IE getsentry/sentry-javascript#3051) I did a quick (not thorough) investigation into performance issues. I did 10 bad password requests. To our live code app vs live preview branch Results
Extra for engineering team:
|
close #906 - Feature/sentry logging revamp
We currently use Sentry to capture errors on the production deployment but it seems it's not doing a very good job because we're mostly clueless whenever a bug happens to show up. I don't know if it's a configuration issue with Sentry or we're just not doing things correctly to send the logs.
Either way, it's worth to take some time to read the docs to better understand this and try to fix, so we can have more reliable logging for bug fixing. Alternatives to Sentry are also welcome if it's reasonable enough to warrant a migration.
Another thing is that logs from dev environments are also being sent, which leads to some confusion when going over the errors on Sentry. Might have to add a condition to only init Sentry when running on production.
c0d3-app/pages/_app.tsx
Lines 20 to 22 in d35f563
So basically, this is what is desired to be improved:
Some useful resources:
The text was updated successfully, but these errors were encountered: