Add option to exclude certain HTTP statuses from tracing in SDK
If not already implemented or only partially implemented: SDK should not trace incoming 404s by default to reduce noise. Add a config option to exclude specific HTTP statuses from tracing. This should mirror existing behavior in other SDKs (Laravel, JavaScript).
- New config option (e.g. trace_ignore_status_codes: [404, ...])
- Backwards compatible (default still traces 404s)
- Tests + docs updated
I recommend this one.
Agree on this, but it may need to be considered a breaking change.
I do this in my projects with this configuration:
sentry:
options:
ignore_exceptions:
- Symfony\Component\Security\Core\Exception\AccessDeniedException
- Symfony\Component\HttpKernel\Exception\NotFoundHttpException
What does an exception has to do with ignoring traces?
Ouch sorry my bad, I mistook this for default config for errors, not traces. In any case, those exceptions are how Symfony reports 404 and 403, so it's still what you may want to intercept.