-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Multiple reports per exception #397
Comments
@dmorneau thanks for opening an issue! 🙂 I was able to reproduce the duplicate Plug/Phoenix.Endpoint reporting, but I couldn't get the third Logger handler. Are you able to publish a small reproduction of the Logger duplication? I tried to look into what may have changed to cause the Plug/Endpoint double report behavior, and tried going back to 1.4, and the same issue exists. Given that, I will see if I can resolve it, but will also beworking to find a more robust way to report errors in Phoenix/Plug outside of having to do |
I think I see the problem with the logger. The Phoenix generators add this config in
With this, if you raise inside a controller handler, the stack trace goes all the way to
But in production, the default stacktrace depth is 8, so the frames after |
Also having this issue, but double not triple, as @mitchellhenke described before. It's because the error is re-raised by Is it possible to handle all errors in Endpoint? use Plug.ErrorHandler
use Sentry.Plug Can this be used in Endpoint, or does it have to be in Router? |
@dmorneau ah, yeah. it's unfortunately a function of having to do heuristics to prevent the duplication. And as @princemaple mentions, using I'll be updating the docs and README accordingly. |
Forgot to mention, but am hoping to have a solution that is entirely driven by Logger without the need for Plug/Endpoint interaction at all to avoid these types of issues. |
@dmorneau I’ve released 8.0.0-rc.1 which should address this issue completely. If you’re able to give the release candidate a try and let me know how it goes, it’s be much appreciated! |
@mitchellhenke The new version looks fantastic, thank you! I filed a couple minor things I noticed doing the upgrade: #408 #409 Duplicate events are gone and the scrubbing looks good 👍 |
@dmorneau greatly appreciate that, thank you!! |
Environment
Description
Every exception in a plug or controllers gets reported three times.
Expected Behavior
A single event per exception
Actual Behavior
There's three Sentry events per exception, with varying amounts of metadata:
I believe these come from Sentry.Plug, Sentry.Phoenix.Endpoint, and Sentry.LoggerBackend respectively.
Steps to Reproduce
Setup a new Phoenix app with:
then add
raise "boom"
inside a controller and try to load the page.I suspect the Phoenix and Cowboy versions are important. This is with Phoenix 1.5.3 and Cowboy 2.8.0. The LoggerHandler seems to check for Cowboy2Handler in the stack trace, which isn't present. Here'a sample
:crash_reason
as received by the logger backend:This is similar to #374.
I'm not sure what causes the duplication between Sentry.Phoenix.Endpoint and Sentry.Plug.
The text was updated successfully, but these errors were encountered: