Skip to content

feat(tracing): [Ignore HTTP Status 3] Filter configured incoming HTTP statuses - #6566

Draft
adinauer wants to merge 2 commits into
feat/ignore404-optionsfrom
feat/ignore404-filter
Draft

adinauer wants to merge 2 commits into
feat/ignore404-optionsfrom
feat/ignore404-filter

Conversation

@adinauer

@adinauer adinauer commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Ignore HTTP Status)


📜 Description

Filter completed incoming HTTP transactions in SentryClient when the root sentry.kind is server and the numeric root http.response.status_code matches a configured ignoredServerHttpStatusCodesForTracing range.

The filter runs before user event processors, beforeSendTransaction, envelope creation, transport, and replay registration. It records one discarded transaction, the root and child spans, and an attached transaction profile with the event_processor reason. Temporary transaction-profile trace files are deleted before returning.

Null or empty configuration keeps all transactions. Missing, malformed, fractional, child-only, and out-of-range status values fail open. Native Integer and OpenTelemetry Long status values are supported without narrowing overflow.

💡 Motivation and Context

This completes the opt-in filtering behavior for #4735 while preserving the current default: no HTTP statuses are ignored unless configured. Filtering happens only after normal transaction, performance-collector, and profiling finalization because the final HTTP response status is not known when tracing starts.

All three Spring Boot generations cover servlet and WebFlux 404 filtering. Documentation includes Java, sentry.properties, Spring application.properties, and application.yml examples.

SDK team review found one profile client-report accounting omission; it was fixed before opening this PR.

Fixes #4735

💚 How did you test it?

  • ./gradlew :sentry:test --tests io.sentry.SentryClientTest --tests io.sentry.SentryTracerTest --rerun-tasks
  • Focused ignored-route integration tests in servlet and WebFlux suites for sentry-spring-boot, sentry-spring-boot-jakarta, and sentry-spring-boot-4
  • make format api
  • git diff --check

📝 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 final PR defaults the option to ignoring incoming HTTP 404 transactions and documents the breaking-change migration path.

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

Drop completed incoming server HTTP transactions when their root response status matches a configured range. Preserve lifecycle finalization while skipping processors, callbacks, envelope creation, and replay registration for filtered transactions.

Record transaction, span, and profile losses, clean up temporary profile traces, and cover Spring Boot servlet and WebFlux integrations.

Fixes #4735
Reference PR #6566 from the user-facing feature entry now that the stacked pull request has been created.
@github-actions

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 c88d883

@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

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant