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

feat(core): Deprecate Span.transaction in favor of getRootSpan #10134

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 10, 2024

This PR deprecates the transaction field on the Span interface and class. Instead, we'll store the span hierarchy in a different format external to the span class. In node-experimental, we use a WeakMap referencing the parent span as a data structure which we might need to generally do in v8. This, however, is a breaking change, so for now we deprecate the field but use it in the replacement utility function for v7.

Replacing most reads of span.transaction was fairly easy - only setting the root span is still done on the deprecated field.

@Lms24 Lms24 requested review from mydea and lforst January 10, 2024 12:36
@Lms24 Lms24 marked this pull request as ready for review January 10, 2024 12:36
Copy link
Contributor

github-actions bot commented Jan 10, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 76.98 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.35 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.37 KB (+0.02% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 30.97 KB (+0.02% 🔺)
@sentry/browser - Webpack (gzipped) 22.31 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 74.61 KB (-0.01% 🔽)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 66.26 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 32.08 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 23.89 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 208.72 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 96.78 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 71.38 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 35.06 KB (+0.05% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.72 KB (+0.01% 🔺)
@sentry/react - Webpack (gzipped) 22.35 KB (+0.07% 🔺)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.39 KB (+0.03% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 49.49 KB (+0.02% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17 KB (+0.08% 🔺)

@Lms24 Lms24 changed the title feat(core): Deprecate Span.tranasction in favor of getRootSpan feat(core): Deprecate Span.transaction in favor of getRootSpan Jan 10, 2024
@@ -66,6 +66,8 @@ export class Transaction extends SpanClass implements TransactionInterface {
this._trimEnd = transactionContext.trimEnd;

// this is because transactions are also spans, and spans have a transaction pointer
// TODO (v8): Replace this with another way to set the root span
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there even a todo for v8 here? Won't we get rid of the transaction class?

Copy link
Member Author

@Lms24 Lms24 Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I mean we somehow still need to construct a transaction for the event payload so I guess it's not gonna vanish completely. We'll just need some way to set and find the root span/txn of a span in v8.

@Lms24 Lms24 force-pushed the lms/feat-code-getRootSpan branch 2 times, most recently from 4ffb363 to f6ce2a9 Compare January 10, 2024 17:16
@Lms24 Lms24 enabled auto-merge (squash) January 10, 2024 17:17
@Lms24 Lms24 disabled auto-merge January 10, 2024 17:17
@Lms24 Lms24 force-pushed the lms/feat-code-getRootSpan branch from f6ce2a9 to c2c20b1 Compare January 11, 2024 11:49
@Lms24 Lms24 merged commit 324e5bf into develop Jan 11, 2024
96 checks passed
@Lms24 Lms24 deleted the lms/feat-code-getRootSpan branch January 11, 2024 16:50
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