-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Sentry.io support to monitor errors #7667
Conversation
Co-Authored-By: Lauris BH <lauris@nix.lv>
Codecov Report
@@ Coverage Diff @@
## master #7667 +/- ##
==========================================
+ Coverage 41.41% 41.41% +<.01%
==========================================
Files 474 474
Lines 63876 63876
==========================================
+ Hits 26453 26455 +2
+ Misses 33978 33975 -3
- Partials 3445 3446 +1
Continue to review full report at Codecov.
|
Sentry requires that you actually tell it about errors - it's not magic. So you would have to next either add multiple specific sentry reporting blocks everywhere that an error is found or, better, just create a sentry logger provider to get it to report an errors. To then make it really useful requires adding context - this is where the real problems start - you're going to have to place sentry calls almost everywhere to give it context. This might be possible with a macaron.Handler at an appropriate level I guess(?) but it might require changing the macaron router code to actually properly handle breadcrumbs, and the login process etc. But all of this, placing code at key points in our system, is to provide logging to a Now... I agree we can do logging better. I agree with Sentry's idea about context - and have been thinking about it quietly for some time (albeit from a python twisted view). Now if we can do this in such a way to improve logging in general - then great let's go for it. My initial reading of the Sentry documentation made me think that you could not host a DSN yourself and that you had to pass data up to their services. I was incorrect. |
@lafriks - ah sorry I missed that you could host a DSN yourself. A quick scan through the documentation implied that you had to pass stuff to their DSN. |
// Sentry.io logging if user wants to investigate internal errors | ||
sentryDSN := os.Getenv("SENTRY_DSN") | ||
if sentryDSN != "" { | ||
if err := sentry.Init(sentry.ClientOptions{ |
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.
We still need repanic: true
?
sentry is a nice choice to get events, it really helps to find problems with code or server itself. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
I just want to add that, besides error tracking, Sentry is also able to track releases* (I would also love to have a gitea webhook for that) and deploys. And yes, as you correctly pointed out, Sentry is open source and you can simply host it on your own with the official Docker images for example. Similar to gitea. *I'm not quite sure whether sentry-go is able to track releases? |
At startup check SENTRY_DSN env variable to activate sentry errors logging. Useful for investigation of bugs.