Skip to content

feat(core): [Ignore HTTP Status 2] Add traceIgnoreStatusCodes configuration - #6559

Open
adinauer wants to merge 3 commits into
feat/ignore404-server-kindfrom
feat/ignore404-options
Open

adinauer wants to merge 3 commits into
feat/ignore404-server-kindfrom
feat/ignore404-options

Conversation

@adinauer

@adinauer adinauer commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Ignore HTTP Status)


📜 Description

Add the nullable traceIgnoreStatusCodes option without changing tracing behavior or configuring any default ignored status codes.

The option accepts HttpStatusCodeRange values through Java. External configuration accepts comma-separated status codes and inclusive ranges such as 404,410,500-599 through sentry.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, and SentryOptionsTest
  • SentryAutoConfigurationTest in sentry-spring-boot, sentry-spring-boot-jakarta, and sentry-spring-boot-4
  • Spotless formatting and checks for affected modules
  • :sentry:checkKotlinAbi
  • Verified generated Spring configuration metadata in all three Spring Boot modules

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The next PR filters configured incoming server HTTP statuses in SentryClient while preserving the current default behavior.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into 9.x.x.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 7b048a0

@sentry

sentry Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.63.0 (1) release

⚙️ sentry-android Build Distribution Settings

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only comment here is about exposing the getter exposing an internal mutable list. Is that safe?

*
* @return the configured HTTP status code ranges, or {@code null} if unset
*/
public @Nullable List<HttpStatusCodeRange> getIgnoredServerHttpStatusCodesForTracing() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: my agent noticed that this differs from the spec traceIgnoreStatusCodes any thoughts on that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll align since with JS removing the option, Java would be the only one with a different name now, not sure how i missed this when i first checked - thx for flagging

@adinauer

Copy link
Copy Markdown
Member Author

Only comment here is about exposing the getter exposing an internal mutable list. Is that safe?

We have mixed getters. IIRC it's mostly the ones that transform, e.g. from String to FilterString that are immutable. This doesn't and since we don't support mutation after init IMO we don't need to change it hence I resolved the bugbot comment.

adinauer and others added 3 commits November 17, 2026 06:53
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
Support unquoted numeric entries in Spring Boot YAML lists while preserving status code validation across Boot 2, 3, and 4.

Refs #4735

Co-Authored-By: Claude <noreply@anthropic.com>
@adinauer
adinauer force-pushed the feat/ignore404-options branch from b0164e1 to 7b048a0 Compare November 17, 2026 08:13
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 17, 2026
@adinauer adinauer changed the title feat(core): [Ignore HTTP Status 2] Add ignoredServerHttpStatusCodesForTracing configuration feat(core): [Ignore HTTP Status 2] Add traceIgnoreStatusCodes configuration Nov 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants