-
Notifications
You must be signed in to change notification settings - Fork 151
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
[BUG] Enhanced exception handling in Laravel causes false positives since 0.65.1 #1352
Comments
Thanks for your report. Basically, you are saying we should only report exceptions which make it to this line: https://github.com/laravel/framework/blob/7acb44de81324d9577b0e161dad38ed6d3ee534d/src/Illuminate/Foundation/Exceptions/Handler.php#L247. Is that correct? |
Pretty much yeah. I'm not sure how you'd tap into that though - if you did have access to laravel app object, you can get |
I've been working on this task. I'm a bit conflicted on the exceptions in the list Can you give us an example of a custom exception and what HTTP status it leads to? Most importantly, an example of one that leads to a 2xx or 3xx code so it wouldn't be an "error". |
I don't personally think that's any useful in this particular case -
5xx are a different story (but you normally wouldn't have an exception type on On the other hand, if they are included in the dd trace I guess I wouldn't mind them being there, as long as the root span isn't marked as an error in this case. The problem with having the root span as an error is that you then can't differentiate between a real error and the normal one (e.g. 'auth failed' error) when monitoring for app errors (either with automatic monitors in dd or just manually looking over the traces with 'error' filter)
Something like an |
We actually have a case where we have an exception that leads to a 2xx. In this case it's for webhook handlers, where the request is for an object we don't know anything about, leading to a Interestingly, this only seems to be an issue in PHP 8 for us, in PHP 7.3 we don't have this problem. Not sure if that's due to changes in Laravel or not… |
Bug description
Enhanced exception handling for Laravel (#1322) seem to have introduced false positive error traces.
https://github.com/DataDog/dd-trace-php/pull/1322/files#diff-65a7a50856c71af24f66a705d37f039a87410525d7e102df692ad7cc110f494fR198 hooks into
Kernel#renderException()
which however is invoked before application'sExceptionHandler
which then determines if the exception is worth reporting - see https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Exceptions/Handler.php#L223This means that exceptions like built-in exceptions
AuthenticationException
etc (as well as your custom exception types that you don't perceive as actual errors) are now being marked as error traces in apm, whereis previously they weren't. Doesn't seem like this is a useful/desired behavior for end-users.PHP version
8.0.8
Diagnostics and configuration
Upgrading info
Upgraded from 0.64 to 0.66.0
The text was updated successfully, but these errors were encountered: