Skip to content

Commit 564cc92

Browse files
andreiborzaclaude
andcommitted
ref: Remove redundant forceTransaction: true usages
Removes `forceTransaction: true` where the span is already a root span, so the option had no effect: - `aws-serverless`: the `function.aws` invocation span - `browser`: the navigation span, which already passes `parentSpan: null` - `nestjs`: the BullMQ process span, since queue jobs run outside a request - `react-router`: the server request span, on the branch that only runs when there is no root span Co-Authored-By: Opus 5 <noreply@anthropic.com>
1 parent 9d0a6f2 commit 564cc92

5 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎packages/aws-serverless/src/requestSpanOptions.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function getRequestSpanOptions(event: unknown, context: Context, requestI
4646
// The span is started within the surrounding `continueTrace`, so it continues the incoming trace.
4747
return {
4848
name: context.functionName,
49-
forceTransaction: true,
5049
attributes: {
5150
[SENTRY_OP]: FUNCTION_AWS,
5251
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.aws_lambda',

‎packages/browser/src/tracing/browserTracingIntegration.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,6 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
520520
...startSpanOptions,
521521
// Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)
522522
parentSpan: null,
523-
forceTransaction: true,
524523
},
525524
true,
526525
navigationOptions?.url,

‎packages/nestjs/src/integrations/helpers.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ const PROCESS_OPERATION = 'process';
130130
export function getBullMQProcessSpanOptions(queueName: string | undefined): {
131131
name: string;
132132
attributes: Record<string, string | undefined>;
133-
forceTransaction: boolean;
134133
} {
135134
const client = getClient();
136135
const isStreamed = !!client && hasSpanStreamingEnabled(client);
@@ -151,7 +150,6 @@ export function getBullMQProcessSpanOptions(queueName: string | undefined): {
151150
[MESSAGING_OPERATION_TYPE]: PROCESS_OPERATION,
152151
[MESSAGING_DESTINATION_NAME]: queueName,
153152
},
154-
forceTransaction: true,
155153
};
156154
}
157155

‎packages/react-router/src/server/createServerInstrumentation.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ export function createSentryServerInstrumentation(
104104
await startSpan(
105105
{
106106
name: unparameterizedName,
107-
forceTransaction: true,
108107
attributes: {
109108
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.server',
110109
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.react_router.instrumentation_api',

‎packages/react-router/test/server/createServerInstrumentation.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,10 @@ describe('createSentryServerInstrumentation', () => {
165165

166166
await hooks.request(mockHandleRequest, { request: mockRequest, context: undefined });
167167

168-
// Should create a new root span with forceTransaction
168+
// Should create a new root span
169169
expect(core.startSpan).toHaveBeenCalledWith(
170170
expect.objectContaining({
171171
name: 'GET /api/users',
172-
forceTransaction: true,
173172
attributes: expect.objectContaining({
174173
'sentry.op': 'http.server',
175174
'sentry.origin': 'auto.http.react_router.instrumentation_api',

0 commit comments

Comments
 (0)