Skip to content

fix(spring): Handle transaction name provider failures - #6241

Merged
adinauer merged 5 commits into
fix/callback-error-handlingfrom
fix/callback-error-handling-spring-transaction-name-provider
Oct 13, 2026
Merged

adinauer merged 5 commits into
fix/callback-error-handlingfrom
fix/callback-error-handling-spring-transaction-name-provider

Conversation

@adinauer

@adinauer adinauer commented Oct 9, 2026

Copy link
Copy Markdown
Member

📜 Description

Handle exceptions from Spring TransactionNameProvider callbacks across event capture, request processing, tracing, and combined providers. Nonfatal failures use <unlabeled transaction> with a custom source, while fatal JVM errors continue to propagate.

Combined providers continue trying later providers after a failure. If none succeeds, they use the safe fallback; ordinary unresolved providers still preserve the existing null result.

The implementation is mirrored across Spring, Spring Jakarta, and Spring 7.

💡 Motivation and Context

A custom transaction-name provider can currently interrupt request processing or event capture. Returning a fixed fallback avoids retaining a partially mutated or sensitive transaction name while keeping the host request available.

The shared TransactionNameProviderUtils classes are public only for cross-package integration use and are annotated @ApiStatus.Internal. Provider-list behavior remains private to CombinedTransactionNameProvider because it has no other production callers.

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry-spring:test :sentry-spring-jakarta:test :sentry-spring-7:test
  • ./gradlew :sentry-spring:apiCheck :sentry-spring-jakarta:apiCheck :sentry-spring-7:apiCheck

📝 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

None.

adinauer and others added 2 commits October 9, 2026 06:27
Keep Spring requests and event capture running when a transaction name provider
throws. Use an unlabeled custom transaction as the privacy-safe fallback and
continue to later providers when resolving combined names.

Apply the same behavior across the Spring, Spring Jakarta, and Spring 7
integrations.

Co-Authored-By: Claude <noreply@anthropic.com>
@sentry

sentry Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@lbloder lbloder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍

@adinauer
adinauer marked this pull request as ready for review October 13, 2026 08:12
@adinauer
adinauer merged commit 6dffaa7 into fix/callback-error-handling Oct 13, 2026
10 checks passed
@adinauer
adinauer deleted the fix/callback-error-handling-spring-transaction-name-provider branch October 13, 2026 08:12
@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Handle transaction name provider failures ([#6241](https://github.com/getsentry/sentry-java/pull/6241))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against bec3873

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.

2 participants