Skip to content
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

Add the Ability to Pass Custom ignore_paths To Query Watcher #1276

Merged
merged 4 commits into from
Dec 5, 2022

Conversation

Watercycle
Copy link
Contributor

Problem

The "file" portion of the Query Watcher is unhelpful if you extend certain classes (e.g. MySqlConnection.php) since that adds a persistent layer to the stack trace.

Solution

One easy fix for this is to allow folks to specify any extra files they want excluded from the stack trace like so:

Watchers\QueryWatcher::class => [
    'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
    'ignore_packages' => true,
    'ignore_paths' => ['MySqlConnection.php'],
    'slow' => 100,
]

(which fixes the above problem)

Where are the tests?

tests/Watchers/QueryWatcherTest.php doesn't try testing 'file' and there isn't a test file for FetchesStackTrace.php. I'm happy to take a go at adding some upon request if this solution seems acceptable. If not, let me know what solution you have in mind.

@taylorotwell taylorotwell merged commit e4b16dd into laravel:4.x Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants