From d41685cebefa4dba184c1ffa321004a2ff18b7ca Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 1 Oct 2026 15:47:21 +0200 Subject: [PATCH 1/2] chore(tracing): Remove unused maxTransactionDurationExceeded span attribute 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 --- packages/core/src/js/tracing/onSpanEndUtils.ts | 2 -- .../core/test/tracing/adjustTransactionDuration.test.ts | 7 ------- 2 files changed, 9 deletions(-) diff --git a/packages/core/src/js/tracing/onSpanEndUtils.ts b/packages/core/src/js/tracing/onSpanEndUtils.ts index aa61b08735..5f7e583946 100644 --- a/packages/core/src/js/tracing/onSpanEndUtils.ts +++ b/packages/core/src/js/tracing/onSpanEndUtils.ts @@ -92,8 +92,6 @@ export const adjustTransactionDuration = (client: Client, span: Span, maxDuratio 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'); } }); }; diff --git a/packages/core/test/tracing/adjustTransactionDuration.test.ts b/packages/core/test/tracing/adjustTransactionDuration.test.ts index 88ecf9836d..9dab75e9b3 100644 --- a/packages/core/test/tracing/adjustTransactionDuration.test.ts +++ b/packages/core/test/tracing/adjustTransactionDuration.test.ts @@ -38,7 +38,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 120); expect(spanToJSON(span).status).toBe('deadline_exceeded'); - expect(spanToJSON(span).data).toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('does not mark span as deadline_exceeded when duration is within maxDurationMs', () => { @@ -53,7 +52,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 30); expect(spanToJSON(span).status).not.toBe('deadline_exceeded'); - expect(spanToJSON(span).data).not.toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('does not mark span as deadline_exceeded when duration equals maxDurationMs exactly', () => { @@ -68,7 +66,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 60); expect(spanToJSON(span).status).not.toBe('deadline_exceeded'); - expect(spanToJSON(span).data).not.toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('marks span as deadline_exceeded when duration is negative', () => { @@ -83,7 +80,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp - 10); expect(spanToJSON(span).status).toBe('deadline_exceeded'); - expect(spanToJSON(span).data).toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('correctly handles maxDurationMs in milliseconds not seconds', () => { @@ -99,7 +95,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 601); expect(spanToJSON(span).status).toBe('deadline_exceeded'); - expect(spanToJSON(span).data).toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('does not mark span when duration is 599 seconds with 600_000ms max', () => { @@ -115,7 +110,6 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 599); expect(spanToJSON(span).status).not.toBe('deadline_exceeded'); - expect(spanToJSON(span).data).not.toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); it('does not affect spans from other transactions', () => { @@ -153,6 +147,5 @@ describe('adjustTransactionDuration', () => { span.end(startTimestamp + 1); expect(spanToJSON(span).status).toBe('deadline_exceeded'); - expect(spanToJSON(span).data).toMatchObject({ maxTransactionDurationExceeded: 'true' }); }); }); From a34060b142139c97e3d4e165437d7166d8e5df17 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 5 Oct 2026 09:13:35 +0200 Subject: [PATCH 2/2] chore: Add changelog entry for maxTransactionDurationExceeded removal --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 496a2f1cd8..178a4e3596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ ## Unreleased +### Changes + +- Remove the undocumented `maxTransactionDurationExceeded` span attribute; use the `deadline_exceeded` span status to filter timed-out transactions instead ([#6820](https://github.com/getsentry/sentry-react-native/pull/6820)) + ### Fixes - Fix stale `turbo_module.*` tags on Android native crashes ([#6823](https://github.com/getsentry/sentry-react-native/pull/6823))