When using pkg/errors a problem we keep encountering is that sentry truncates the error message, which removes relevant information that has been annotated on the error via Wrapf. I looked into adding this into the StackTraceFrame but it would include a mountain of changes including ones upstream in raven-go.
This instead adds a new option IncludeErrorBreadcrumb which when true will add a breadcrumb to the sentry report that includes the verbose print of the error. When using pkg/errors this gives you a full trace including the annotations.
Totally understand if this isn't something you want to merge but leaving this here as maybe it will be useful to others. The "right" way to do this is to annotate each StackTraceFrame with vars in the cases where there is an annotation. This would require tweaking pkg/errors to get at the error message at that level (and not only the recursive error message) and tweaking getsentry/raven-go to let us set vars on a StackTraceFrame.
Coverage decreased (-1.3%) to 81.19% when pulling c2962b80ba7d827510f5c06131240fbc7180f391 on nyaruka:master into 4034fb124d4e039c84e66e70f40ee32343f0ea19 on evalphobia:master.
When using
pkg/errors
a problem we keep encountering is that sentry truncates the error message, which removes relevant information that has been annotated on the error viaWrapf
. I looked into adding this into the StackTraceFrame but it would include a mountain of changes including ones upstream in raven-go.This instead adds a new option
IncludeErrorBreadcrumb
which when true will add a breadcrumb to the sentry report that includes the verbose print of the error. When usingpkg/errors
this gives you a full trace including the annotations.Totally understand if this isn't something you want to merge but leaving this here as maybe it will be useful to others. The "right" way to do this is to annotate each StackTraceFrame with
vars
in the cases where there is an annotation. This would require tweakingpkg/errors
to get at the error message at that level (and not only the recursive error message) and tweakinggetsentry/raven-go
to let us setvars
on a StackTraceFrame.