laravel / telescope

An elegant debug assistant for the Laravel framework.
https://laravel.com/docs/telescope
MIT License
4.77k stars 560 forks source link

Add ignore paths option for request watcher #1456

Closed niteen1593 closed 3 months ago

niteen1593 commented 3 months ago

This pull request introduces a new configuration option, ignore_paths, to the RequestWatcher class in Telescope.

Motivation: Currently, Telescope provides a global configuration option to specify paths to be ignored, but there isn't a way to ignore specific request URIs at the level of the RequestWatcher class. Consequently, when we configure ignore_paths globally, it applies to all watchers except QueryWatcher. This limitation prevents monitoring of other watchers such as JobWatcher.

By default, Telescope ignores certain paths like

 'ignore_paths' => [
        'livewire*',
        'nova-api*',
        'pulse*',
    ],

However, this global setting ignores all livewire request so we can't monitor Event, Job or Job Batch dispatched in livewire request. This pull request resolves this issue by allowing for more granular control over ignored paths within the RequestWatcher.

taylorotwell commented 3 months ago

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

niteen1593 commented 3 months ago

Thanks @taylorotwell for reviewing my PR. I have gone through changes made in this PR multiple times And think this will be great option if it will part of framework that will help users to ignore request path directly from framework config instead of pulling one more package to achieve this simple functionality. Thanks