Skip to content

Commit fef09bd

Browse files
committed
rename to forceTransaction
1 parent 2b59c84 commit fef09bd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/core/src/tracing/trace.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function startSpan<T>(context: StartSpanOptions, callback: (span: Span |
3636
: createChildSpanOrTransaction(hub, {
3737
parentSpan,
3838
spanContext,
39-
isTransaction: context.isTransaction,
39+
forceTransaction: context.forceTransaction,
4040
scope,
4141
});
4242

@@ -85,7 +85,7 @@ export function startSpanManual<T>(
8585
: createChildSpanOrTransaction(hub, {
8686
parentSpan,
8787
spanContext,
88-
isTransaction: context.isTransaction,
88+
forceTransaction: context.forceTransaction,
8989
scope,
9090
});
9191

@@ -147,7 +147,7 @@ export function startInactiveSpan(context: StartSpanOptions): Span | undefined {
147147
return createChildSpanOrTransaction(hub, {
148148
parentSpan,
149149
spanContext,
150-
isTransaction: context.isTransaction,
150+
forceTransaction: context.forceTransaction,
151151
scope: temporaryScope,
152152
});
153153
}
@@ -267,12 +267,12 @@ function createChildSpanOrTransaction(
267267
{
268268
parentSpan,
269269
spanContext,
270-
isTransaction,
270+
forceTransaction,
271271
scope,
272272
}: {
273273
parentSpan: Span | undefined;
274274
spanContext: TransactionContext;
275-
isTransaction?: boolean;
275+
forceTransaction?: boolean;
276276
scope: Scope;
277277
},
278278
): Span | undefined {
@@ -283,7 +283,7 @@ function createChildSpanOrTransaction(
283283
const isolationScope = getIsolationScope();
284284

285285
let span: Span | undefined;
286-
if (parentSpan && !isTransaction) {
286+
if (parentSpan && !forceTransaction) {
287287
// eslint-disable-next-line deprecation/deprecation
288288
span = parentSpan.startChild(spanContext);
289289
addChildSpanToSpan(parentSpan, span);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe('startSpan', () => {
333333
expect(getActiveSpan()).toBe(undefined);
334334
});
335335

336-
it('allows to force a transaction with isTransaction=true', async () => {
336+
it('allows to force a transaction with forceTransaction=true', async () => {
337337
const options = getDefaultTestClientOptions({ tracesSampleRate: 1.0 });
338338
client = new TestClient(options);
339339
setCurrentClient(client);
@@ -350,7 +350,7 @@ describe('startSpan', () => {
350350

351351
startSpan({ name: 'outer transaction' }, () => {
352352
startSpan({ name: 'inner span' }, () => {
353-
startSpan({ name: 'inner transaction', isTransaction: true }, () => {
353+
startSpan({ name: 'inner transaction', forceTransaction: true }, () => {
354354
startSpan({ name: 'inner span 2' }, () => {
355355
// all good
356356
});
@@ -623,7 +623,7 @@ describe('startSpanManual', () => {
623623
expect(getActiveSpan()).toBe(undefined);
624624
});
625625

626-
it('allows to force a transaction with isTransaction=true', async () => {
626+
it('allows to force a transaction with forceTransaction=true', async () => {
627627
const options = getDefaultTestClientOptions({ tracesSampleRate: 1.0 });
628628
client = new TestClient(options);
629629
setCurrentClient(client);
@@ -640,7 +640,7 @@ describe('startSpanManual', () => {
640640

641641
startSpanManual({ name: 'outer transaction' }, span => {
642642
startSpanManual({ name: 'inner span' }, span => {
643-
startSpanManual({ name: 'inner transaction', isTransaction: true }, span => {
643+
startSpanManual({ name: 'inner transaction', forceTransaction: true }, span => {
644644
startSpanManual({ name: 'inner span 2' }, span => {
645645
// all good
646646
span?.end();
@@ -852,7 +852,7 @@ describe('startInactiveSpan', () => {
852852
expect(getActiveSpan()).toBeUndefined();
853853
});
854854

855-
it('allows to force a transaction with isTransaction=true xxx', async () => {
855+
it('allows to force a transaction with forceTransaction=true xxx', async () => {
856856
const options = getDefaultTestClientOptions({ tracesSampleRate: 1.0 });
857857
client = new TestClient(options);
858858
setCurrentClient(client);
@@ -869,7 +869,7 @@ describe('startInactiveSpan', () => {
869869

870870
startSpan({ name: 'outer transaction' }, () => {
871871
startSpan({ name: 'inner span' }, () => {
872-
const innerTransaction = startInactiveSpan({ name: 'inner transaction', isTransaction: true });
872+
const innerTransaction = startInactiveSpan({ name: 'inner transaction', forceTransaction: true });
873873
innerTransaction?.end();
874874
});
875875
});

packages/types/src/startSpanOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export interface StartSpanOptions extends TransactionContext {
2020
/** An op for the span. This is a categorization for spans. */
2121
op?: string;
2222

23-
/** If set to true, this span will be treated as a transaction in the Sentry UI. */
24-
isTransaction?: boolean;
23+
/** If set to true, this span will be forced to be treated as a transaction in the Sentry UI. */
24+
forceTransaction?: boolean;
2525

2626
/**
2727
* The origin of the span - if it comes from auto instrumentation or manual instrumentation.

0 commit comments

Comments
 (0)