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(telemetry): Only trace step if there is an active span #345

Closed
wants to merge 1 commit into from

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 7, 2023

This PR fixes a bug where we would start a trace when Sentry was not enabled. This happened when starting the source maps wizard w/o the -i flag.

#skip-changelog

@Lms24 Lms24 requested a review from mydea July 10, 2023 08:24
@mydea
Copy link
Member

mydea commented Jul 10, 2023

hmm, this is an interesting wrinkle to the trace function 🤔 maybe there should be flag or so like onlyIfNotRoot or whatever 😓 cc @AbhiPrasad

@Lms24
Copy link
Member Author

Lms24 commented Jul 10, 2023

I believe I should add a little more information here so that everyone has the necessary context:

The bug I'm fixing here is that users get the following console warning when starting the wizard without the -i arg, everytime my traceStep helper calls trace:

Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});

This warning is emitted because when manually selecting the source maps wizard flow (i.e. no -i arg), we don't yet initialize the SDK. So we call trace without Sentry being initialized and hence the tracing extension methods are missing.

Given that trace is meant for internal use only, it's okay that this currently errors but I think we can fix this nevertheless in the SDK. I'll open a PR for it!

Lol, never mind, this was already fixed in 7.57.0 via getsentry/sentry-javascript#8357 🤦‍♂️

@Lms24
Copy link
Member Author

Lms24 commented Jul 10, 2023

Closing, SDK bump should be enough lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants