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

[Bug]: Laravel $dontReport does not have any affect on CLI #2784

Open
lifeofguenter opened this issue Aug 6, 2024 · 1 comment
Open

[Bug]: Laravel $dontReport does not have any affect on CLI #2784

lifeofguenter opened this issue Aug 6, 2024 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@lifeofguenter
Copy link

Bug report

In Laravel it is possible to ignore certain Exceptions: https://laravel.com/docs/10.x/errors#ignoring-exceptions-by-type

Many are also already ignored by default, such as "ModelNotFoundException": https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Exceptions/Handler.php#L146

This works for web requests in APM, but for CLI requests those exceptions still get recorded.

PHP version

8.3.10

Tracer or profiler version

1.2.0

Installed extensions

No response

Output of phpinfo()

No response

Upgrading from

No response

@lifeofguenter lifeofguenter added the 🐛 bug Something isn't working label Aug 6, 2024
@pablomartinezbernardo
Copy link
Contributor

Hey, thanks for this!

Tested this with Laravel 11 by adding an exception to the dontReport list, and running a cli command that triggers that exception: The spans are generated and the error is ignored as expected.

->withExceptions(function (Exceptions $exceptions) {
        $exceptions->dontReport([
            Symfony\Component\Console\Exception\NamespaceNotFoundException::class,
        ]);

What version of laravel are you using? Are you manually ignoring more exceptions than the default ones? What is different between your expectations and the spans being generated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants