sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Add option to exclude certain HTTP statuses from tracing in SDK

Open dingsdax opened this issue 4 months ago • 2 comments

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

dingsdax avatar Sep 17 '25 14:09 dingsdax

While https://github.com/getsentry/sentry-java/issues/4736 requires a new major, this does not so long as we don't add any default values (as suggested here).

adinauer avatar Sep 18 '25 07:09 adinauer