Skip to content

Commit 922fb0e

Browse files
committed
add source to manual startTransaction
1 parent f42cab1 commit 922fb0e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/hub/src/exports.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ export function withScope(callback: (scope: Scope) => void): ReturnType<Hub['wit
168168
* The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
169169
* finished child spans will be sent to Sentry.
170170
*
171+
* NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call
172+
* `startTransaction` directly on the hub.
173+
*
171174
* @param context Properties of the new `Transaction`.
172175
* @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
173176
* default values). See {@link Options.tracesSampler}.
@@ -178,5 +181,11 @@ export function startTransaction(
178181
context: TransactionContext,
179182
customSamplingContext?: CustomSamplingContext,
180183
): ReturnType<Hub['startTransaction']> {
181-
return getCurrentHub().startTransaction({ ...context }, customSamplingContext);
184+
return getCurrentHub().startTransaction(
185+
{
186+
metadata: { source: 'custom' },
187+
...context,
188+
},
189+
customSamplingContext,
190+
);
182191
}

0 commit comments

Comments
 (0)