Comments (6)
This is probably because the exception is caused by framework code and not triggered by your own. You are showing an example for a relation not found error triggered by Eloquent, it's really hard to know why or what is actually triggering the error from your screenshots though.
By default we mark only code in your app
folder as "in app". This causes the stacktrace in Sentry to be collapsed and only frames from your application code are highlighted unless you open the full stack trace.
So the stack trace is "correct", but for some errors no code from your own application is triggering the actual error causing these kind of stack traces.
Anyway, I'm not sure it makes sense what I am saying but the stack trace is correct, it's just a little confusing in this specific instance.
from sentry-laravel.
Stack trace is correct on both screens, but in "Expected result" is more accurate. In this case, Laravel Nova used relation that does not exist, so actually no app code was executed.
In cases like that, Sentry indicates on first in-app code that was included in stack-trace and in most cases it will be Middleware, because they participate in every requests.
This can be confusing, but, as I think now, probably there is no better method. Maybe middlewares should not be "Most relevant" if they are not causing error directly?
I'm also not sure if it's the responsibility of this package.
from sentry-laravel.
Yeah I totally get what you are saying. I'm not sure there is a good way for us to solve this though. I understand the "Most Relevant" here is misleading but it's also not because of the way middlewares work and your code is usually the most relevant...
Maybe we should exclude middlewares as in-app frames although currently I don't think that is very easy to do. This is because in_app_include
(where we add app/
) takes precedense over in_app_exclude
(where we could add app/Http/Middleware/
): https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#in-app-exclude.
We obviously also don't want to modify the stacktraces too much to prevent us inadvertently messing them up or making them factually incorrect which would be even more bad.
But in these cases where you have a lot of logic in a vendor package the in app frames are meh. Maybe you could add vendor/laravel/nova/
to in_app_include
to make the stacks from errors in Nova a little more clearer for you.
from sentry-laravel.
Can we made in_app_include
and in_app_exclude
configurable from sentry.php? I'm thinking about removing app/
from in_app_include and leaving it blank or making it more precise like app/Controllers
, app/Models
etc.
Generally in_app_exclude should have precendence over in_app_include, it makes more sense and would be more flexilbe.
from sentry-laravel.
They are, just add them 😉
Edit: This is our default, we only define the exclude by default (and you can override this by adding the key to config/sentry.php
yourself if you need to):
sentry-laravel/src/Sentry/Laravel/ServiceProvider.php
Lines 230 to 236 in 6766731
So I was wrong by saying we define app/
as in_app_include
instead we exclude the vendor directory, so you can add for example vendor/laravel/nova
to in_app_include
and it would show frames from Nova as in-app while keeping the rest of you vendor folder excluded (assuming you don't change in_app_exclude
).
So you could do something like this for example:
'in_app_include' => [
base_path('/vendor/laravel/nova'), // if you want Nova to show up as in-app frames
],
'in_app_exclude' => [
base_path('/vendor'),
base_path('app/Http/Middleware'), // to exlcude middleware from showing as in-app frames
],
from sentry-laravel.
As @stayallive wrote, this can be easily customised on the app level, using in_app_include/in_app_exclude
. I don't think it's feasible to change any defaults.
from sentry-laravel.
Related Issues (20)
- Dependency nyholm/psr7 can be defined like require-dev HOT 1
- Does captureUnhandleException still work for Laravel 11 HOT 1
- SQLSTATE[HY000]: General error: 2006 MySQL server has gone away HOT 6
- Metrics Rate Limits HOT 1
- FilesystemAdapterDecorator incompatibility in tests. HOT 2
- Performance monitoring doesn't work in artisan commands
- LighthouseIntegration does not report all the traces to Sentry HOT 4
- Call to undefined function Sentry\metrics() HOT 8
- Setting http_proxy in config/sentry.php on L10 seems to not work HOT 2
- before_send_check_in breaks serialization when using php artisan optimize HOT 4
- Possible bug if transaction is not sampled? HOT 4
- Sentry delays execution of scheduled commands when offline HOT 4
- Inform via Log in case Sentry Requests Timeout or Fail HOT 1
- Ingestion Requests affect API Response Times for Users HOT 1
- Sentry Cron Lumen not work HOT 2
- `queue.publish` span takes very long without any clear reason HOT 4
- Metrics are not flushed when used in jobs HOT 6
- Ensure out-of-memory errors are reported HOT 1
- Error: Call to undefined method Sentry\Options::getLoggerOrNullLogger() HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-laravel.