Repository navigation
Conversation
Add an unset option for ignored incoming server HTTP status codes and ranges. Parse external configuration without clearing existing values when all entries are invalid, and support Spring Boot binding across all supported versions. This PR only adds configuration surfaces; filtering remains unchanged. Refs #4735
|
📲 Install BuildsAndroid
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 74bc19a. Configure here.
| */ | ||
| public @Nullable List<HttpStatusCodeRange> getIgnoredServerHttpStatusCodesForTracing() { | ||
| return ignoredServerHttpStatusCodesForTracing; | ||
| } |
There was a problem hiding this comment.
Getter exposes internal mutable list
Medium Severity
getIgnoredServerHttpStatusCodesForTracing() returns the internal list instead of a copy. Callers can add, remove, or clear ranges without the setter, so later reads can disagree with what was configured. Other ignored-* getters return a copy for this reason, and changing that later would be a public API behavior change.
Triggered by learned rule: Ignored-filter getters return List of String
Reviewed by Cursor Bugbot for commit 74bc19a. Configure here.
| throw invalidRange(value); | ||
| } | ||
| return new HttpStatusCodeRange(min, max); | ||
| } |
There was a problem hiding this comment.
YAML list integers fail conversion
Medium Severity
Spring Boot can bind this option from a YAML sequence, and unquoted codes such as 404 arrive as integers while ranges such as 500-599 arrive as strings. HttpStatusCodeRange only offers valueOf(String) and an int constructor, so integer elements do not convert and context startup fail-fasts. Comma-separated string binding still works; other Sentry list properties accept YAML sequences.
Reviewed by Cursor Bugbot for commit 74bc19a. Configure here.


PR Stack (Ignore HTTP Status)
📜 Description
Add the nullable
ignoredServerHttpStatusCodesForTracingoption without changing tracing behavior or configuring any default ignored status codes.The option accepts
HttpStatusCodeRangevalues through Java. External configuration accepts comma-separated status codes and inclusive ranges such as404,410,500-599throughsentry.properties, JVM system properties, and environment variables. Missing values preserve existing programmatic configuration, while an explicit empty value clears the list.Spring Boot configuration binding is covered across all three supported Spring Boot modules. A shared
HttpStatusCodeRange.valueOf(String)parser keeps Spring and external parsing consistent and validates HTTP status codes within 100-599.💡 Motivation and Context
This is the configuration layer for #4735. It intentionally does not consume the option yet, so incoming HTTP transactions continue to be traced exactly as before. The next PR adds opt-in filtering for configured status codes.
Malformed external entries are logged and ignored without aborting SDK initialization. Mixed valid and invalid values retain the valid ranges, and an all-invalid non-empty value does not clear existing configuration. Spring Boot retains its normal fail-fast configuration binding behavior for invalid values.
Refs #4735
💚 How did you test it?
HttpStatusCodeRangeTest,ExternalOptionsTest, andSentryOptionsTestSentryAutoConfigurationTestinsentry-spring-boot,sentry-spring-boot-jakarta, andsentry-spring-boot-4:sentry:checkKotlinAbi📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The next PR filters configured incoming server HTTP statuses in
SentryClientwhile preserving the current default behavior.#skip-changelog