Uh oh!
There was an error while loading. Please reload this page.
feat: Option to not trace HTTP requests based on status codes - #4869
Conversation
❌ 78 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sentrivana
commented
Oct 1, 2025
One more thing -- we should also record the dropped transaction in a client report. Check |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
sentrivana
left a comment
There was a problem hiding this comment.
One last thing, otherwise looks great!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
Add
trace_ignore_status_codesoption to exclude HTTP requests from tracing if they have certain status codes. A debug-level log message is printed if a transaction is dropped because its status code is ignored. By default no status codes automatically cause transactions to be dropped, although this will change in the next major.Issues
Closes#4812
Reminders
tox -e linters.feat:,fix:,ref:,meta:)Note
Adds a configurable option to skip tracing transactions when HTTP response status matches specified codes or ranges, with logging and tests.
Transaction._in_http_status_code_range()and use it inTransaction.finish()to setsampled=Falsewhendata['http.response.status_code']matchesclient.options['trace_ignore_status_codes']; warn on non-int status types; log debug when discarded._get_log_representation()and reuse in sampling logs.trace_ignore_status_codesinit option and document it inClientConstructor.__init__docstring.tests/tracing/test_ignore_status_codes.pycovering single codes, ranges, mixed lists, malformed config, invalid status type, and default behavior.Written by Cursor Bugbot for commit ed08547. This will update automatically on new commits. Configure here.