Skip to content

chore(tracing): Remove unused maxTransactionDurationExceeded span attribute - #6820

Open
antonis wants to merge 3 commits into
mainfrom
chore/remove-maxtransactionduration-attribute
Open

antonis wants to merge 3 commits into
mainfrom
chore/remove-maxtransactionduration-attribute

Conversation

@antonis

@antonis antonis commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

adjustTransactionDuration (onSpanEndUtils.ts) set a maxTransactionDurationExceeded span-data flag alongside the deadline_exceeded status. This removes the flag (and the stale // TODO: check where was used, might be possible to delete next to it). The deadline_exceeded status and both duration guards (diff < 0, recorded-duration-exceeds-finalTimeout) are unchanged.

💡 Motivation and Context

The flag is a leftover from the old @sentry/tracing maxTransactionDuration option, which upstream replaced with finalTimeout in v7 (getsentry/sentry-javascript#5044). It only survives in archived @sentry/tracing mirrors.

Timeline

  • 2021-01-19 — maxTransactionDurationExceeded added to the RN SDK (#1230), mirroring the old @sentry/tracing adjustTransactionDuration (which set it as a tag).
  • 2022-05-06 — Upstream removes it in sentry-javascript v7.0.0 (#5044), replacing the maxTransactionDuration option with finalTimeout (the diff deletes transaction.setTag('maxTransactionDurationExceeded', 'true')).
  • 2024-05-29 — RN v8 migration (#3836) keeps the flag, now set as a span attribute, still alongside the deadline_exceeded status.
  • 2026-10 — Removed here, ~4.4 years after upstream dropped it. It was never deprecated in either repo — both removed it outright.

The deadline_exceeded status is set on the exact same transactions (the same if (isOutdatedTransaction) branch), and @sentry/core's idle span also emits it on finalTimeout, so it remains the signal to filter timed-out transactions on.

💚 How did you test it?

  • CI
  • Verified no usage in the org
  • Checked the data: Across configured queries (metric/issue alerts, saved searches, Discover saved queries, and dashboard widgets) there are 0 references of maxTransactionDurationExceeded, vs 171 orgs using the deadline_exceededstatus filter

📝 Checklist

  • I added tests to verify 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.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

…ribute

The `adjustTransactionDuration` handler set a `maxTransactionDurationExceeded`
span-data flag alongside the `deadline_exceeded` status. The flag is a leftover
from the old `@sentry/tracing` `maxTransactionDuration` option, which upstream
replaced with `finalTimeout` in v7 (getsentry/sentry-javascript#5044). Nothing
consumes it: no references in sentry, relay, or current sentry-javascript, and
`@sentry/core` already records the modern equivalent
(`sentry.idle_span_finish_reason: "finalTimeout"`) when the idle span times out.

Drop the dead attribute. The `deadline_exceeded` status and both duration guards
are unchanged; tests still assert the status.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • chore(tracing): Remove unused maxTransactionDurationExceeded span attribute by antonis in #6820
  • fix(android): Settle initNativeReactNavigationNewFrameTracking promise by antonis in #6823
  • fix(spotlight): Forward image attachments to Spotlight by antonis in #6818
  • fix(ios): Prevent crash when initialized with an invalid DSN by antonis in #6825
  • chore(core): Resolve non-actionable TODOs by antonis in #6826
  • chore(core): resolve stale TODO comments by antonis in #6819
  • fix(profiling): Populate Hermes runtime version on JS profiles by antonis in #6817

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against a34060b

@antonis
antonis marked this pull request as ready for review October 1, 2026 13:50
Comment on lines 92 to -96

if (isOutdatedTransaction) {
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' });
// TODO: check where was used, might be possible to delete
span.setAttribute('maxTransactionDurationExceeded', 'true');

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.

Won't this be a break change with users alert filters?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for calling this out @lucas-zimerman 🙇 I've rechecked the data with HEX: Across configured queries (metric/issue alerts, saved searches, Discover saved queries, and dashboard widgets) there are 0 references of maxTransactionDurationExceeded, vs 171 orgs using the deadline_exceededstatus filter.

if we decide to keep it as a minor, we should add a field on the changelog about it.

Makes sense 👍 Added a changelog entry. Also updated the PR description adding the full timeline of the attribute.

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.

Thank you for your investigation!
It still could affect self hosted but id say so far so good for a release

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It still could affect self hosted but id say so far so good for a release

True 👍 I'd advocate on shipping the removal now and crossing this off but we could also keep it for the v9 bump. I'll leave the final approval to @alwx 🙇

@lucas-zimerman

Copy link
Copy Markdown
Collaborator

if we decide to keep it as a minor, we should add a field on the changelog about it.

@antonis
antonis requested a review from lucas-zimerman October 5, 2026 07:18

@lucas-zimerman lucas-zimerman 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!

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