-
Notifications
You must be signed in to change notification settings - Fork 86
Add WithStack to Client calls to split individual errors in Sentry #2066
base: master
Are you sure you want to change the base?
Conversation
Ike Plugins (test-keeper)Thank you @aslakknutsen for this contribution! It appears that no tests have been added or updated in this PR. Automated tests give us confidence in shipping reliable software. Please add some as part of this change. If you are an admin or the reviewer of this PR and you are sure that no test is needed then you can use the command Your plugin configuration is stored in the file. |
@aslakknutsen snapshot fabric8-wit image is available for testing. |
Codecov Report
@@ Coverage Diff @@
## master #2066 +/- ##
=======================================
Coverage 67.18% 67.18%
=======================================
Files 157 157
Lines 14189 14189
=======================================
Hits 9533 9533
Misses 3760 3760
Partials 896 896
Continue to review full report at Codecov.
|
@aslakknutsen what is the best practice around using Because IIUC controller methods when they return the error is directly a user facing one, do we want to show stack traces there? |
@surajssd I think the reason why Sentry is getting a bit confused is that there are certain places we 'move an err' untouched all the way out. This could happen especially around 'external calls to other libs/clients' etc that does not use stacks. Showing the stack to the user is a different story, that needs to be filtered regardless in a level above. Assuming that this experiment works; I would argue we should start wrapping at the first point where we know it's not wrapped? errors from go core, pg, http clients etc |
Out of curiosity, I did some experimenting. I was curious to see what would happen if a WithStack error was wrapped. Turns out you end up with both stack traces, so at least information isn't lost. It would be great if WithStack() and Wrap() checked and only added a stack if none present. (I have a sample implementation but it uses reflection because it lives on top of the existing pkg/errors code). |
@stooke maybe something to bring upstream? |
@aslakknutsen, I was thinking about submitting it, but I need to do some thinking on the impact of reflection in Go - my current implementation tests for the type, and that can be inefficient (although it's the error path, so probably not really an issue) |
No description provided.