Skip to content

Commit

Permalink
fix(core): Log warning when tracing extensions are missing (#7601)
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish authored Apr 11, 2023
1 parent 781c3a9 commit a9621fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,17 @@ export class Hub implements HubInterface {
* @inheritDoc
*/
public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {
return this._callExtensionMethod('startTransaction', context, customSamplingContext);
const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);

if (__DEBUG_BUILD__ && !result) {
// eslint-disable-next-line no-console
console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`);
}

return result;
}

/**
Expand Down

0 comments on commit a9621fc

Please sign in to comment.