Skip to content

fix(node): More relevant warning message when tracing extensions are missing #8820

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

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/core/src/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,19 @@ export class Hub implements HubInterface {
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':
const client = this.getClient();
if (!client) {
// eslint-disable-next-line no-console
console.warn(
"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'",
);
} else {
// 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