Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Log warning when tracing extensions are missing #7601

Merged
merged 9 commits into from
Apr 11, 2023
12 changes: 11 additions & 1 deletion packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,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) {
throw new Error(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
timfish marked this conversation as resolved.
Show resolved Hide resolved

Sentry.addTracingExtensions();
Sentry.init({...});
`);
}

return result;
}

/**
Expand Down