Skip to content

Commit ca6bd4d

Browse files
committed
remove finish reason tag
1 parent 79c4777 commit ca6bd4d

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

packages/core/src/tracing/idleSpan.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ import { getSpanDescendants, removeChildSpanFromSpan, spanTimeInputToSeconds, sp
99
import { SentryNonRecordingSpan } from './sentryNonRecordingSpan';
1010
import { SPAN_STATUS_ERROR } from './spanstatus';
1111
import { startInactiveSpan } from './trace';
12-
import { getActiveSpan, getCapturedScopesOnSpan } from './utils';
12+
import { getActiveSpan } from './utils';
1313

1414
export const TRACING_DEFAULTS = {
1515
idleTimeout: 1_000,
1616
finalTimeout: 30_000,
1717
childSpanTimeout: 15_000,
1818
};
1919

20-
const FINISH_REASON_TAG = 'finishReason';
21-
2220
const FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed';
2321
const FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout';
2422
const FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout';
@@ -245,22 +243,6 @@ export function startIdleSpan(startSpanOptions: StartSpanOptions, options: Parti
245243
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason);
246244
}
247245

248-
// Save finish reason as tag, in addition to attribute, to maintain backwards compatibility
249-
const scopes = getCapturedScopesOnSpan(span);
250-
251-
// Make sure to fetch up-to-date data here, as it may have been updated above
252-
const finalAttributes: SpanAttributes = spanToJSON(span).data || {};
253-
const finalFinishReason = finalAttributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON];
254-
if (scopes.scope && typeof finalFinishReason === 'string') {
255-
// We only want to add the tag to the transaction event itself
256-
scopes.scope.addEventProcessor(event => {
257-
if (event.type === 'transaction') {
258-
event.tags = { ...event.tags, [FINISH_REASON_TAG]: finalFinishReason };
259-
}
260-
return event;
261-
});
262-
}
263-
264246
DEBUG_BUILD &&
265247
logger.log('[Tracing] finishing idle span', new Date(endTimestamp * 1000).toISOString(), spanJSON.op);
266248

packages/core/test/lib/tracing/idleSpan.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ describe('startIdleSpan', () => {
296296
expect(transaction?.contexts?.trace?.data?.[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]).toEqual(
297297
'idleTimeout',
298298
);
299-
expect(transaction?.tags?.finishReason).toEqual('idleTimeout');
300299
});
301300

302301
it('uses finish reason set outside when span ends', () => {
@@ -320,7 +319,6 @@ describe('startIdleSpan', () => {
320319
expect(transaction?.contexts?.trace?.data?.[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]).toEqual(
321320
'custom reason',
322321
);
323-
expect(transaction?.tags?.finishReason).toEqual('custom reason');
324322
});
325323

326324
describe('idleTimeout', () => {

0 commit comments

Comments
 (0)