Skip to content

Commit a9621fc

Browse files
authored
fix(core): Log warning when tracing extensions are missing (#7601)
1 parent 781c3a9 commit a9621fc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/core/src/hub.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,17 @@ export class Hub implements HubInterface {
385385
* @inheritDoc
386386
*/
387387
public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {
388-
return this._callExtensionMethod('startTransaction', context, customSamplingContext);
388+
const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);
389+
390+
if (__DEBUG_BUILD__ && !result) {
391+
// eslint-disable-next-line no-console
392+
console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
393+
Sentry.addTracingExtensions();
394+
Sentry.init({...});
395+
`);
396+
}
397+
398+
return result;
389399
}
390400

391401
/**

0 commit comments

Comments
 (0)