feat: add TraceIgnoreStatusCodes option#1089
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1089 +/- ##
==========================================
- Coverage 86.97% 86.90% -0.07%
==========================================
Files 55 56 +1
Lines 6025 6072 +47
==========================================
+ Hits 5240 5277 +37
- Misses 641 649 +8
- Partials 144 146 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lcian
approved these changes
Sep 19, 2025
Member
lcian
left a comment
There was a problem hiding this comment.
Implementation looks good to me.
cleptric
reviewed
Sep 22, 2025
cleptric
reviewed
Sep 23, 2025
cleptric
reviewed
Sep 23, 2025
58fa879 to
55f3d01
Compare
Contributor
Author
|
Going with the span attribute solution in the end, to adhere to getsentry/sentry-docs#15026 |
cleptric
reviewed
Sep 26, 2025
Member
cleptric
left a comment
There was a problem hiding this comment.
Missing the debug log from the spec.
lcian
approved these changes
Sep 29, 2025
cleptric
approved these changes
Sep 30, 2025
Member
cleptric
left a comment
There was a problem hiding this comment.
Please also add the new option to https://docs.sentry.io/platforms/go/configuration/options/ and https://docs.sentry.io/platforms/go/configuration/filtering/.
lcian
approved these changes
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add client option for ignoring traces with specific status codes.
Issues
Note
Adds a client option to ignore tracing for specified HTTP status codes or ranges, with implementation, tests, and an example.
ClientOptions.TraceIgnoreStatusCodes [][]intto configure status codes/ranges to exclude from tracing.Span.shouldIgnoreStatusCode()to setSampledFalseand drop transactions whenData["http.response.status_code"]matches configured codes/ranges.Span.doFinish()when ignored.client_test.gocovering empty/missing status, single codes, ranges, mixed lists, and non-int values._examples/trace-ignore-status-codes/main.godemonstrating configuration and behavior.Written by Cursor Bugbot for commit efb82ec. This will update automatically on new commits. Configure here.