Skip to content

feat(core): Add parentSpan option to startSpan* APIs #12567

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
Jun 20, 2024
Merged

Conversation

mydea
Copy link
Member

@mydea mydea commented Jun 19, 2024

With this PR, you can now pass a parentSpan optionally to startSpan* APIs to create a span as a child of a specific span:

const span = Sentry.startInactiveSpan({ name: 'xxx', parentSpan: parent });

Sentry.startSpan({ name: 'xxx', parentSpan: parent }, () => {});

Sentry.startSpanManual({ name: 'xxx', parentSpan: parent }, () => {});

With this, it should be easier to understand how you can manually work with spans in v8.

Closes #12539

ref #12566, which I noticed while working on this. For now I just cast the span which should be fine, but is not ideal.

@mydea mydea requested review from lforst and AbhiPrasad June 19, 2024 14:56
@mydea mydea self-assigned this Jun 19, 2024
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser 22.22 KB (0%)
@sentry/browser (incl. Tracing) 33.31 KB (+0.11% 🔺)
@sentry/browser (incl. Tracing, Replay) 69.09 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.41 KB (+0.07% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) 73.14 KB (+0.04% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback) 85.31 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 87.17 KB (+0.09% 🔺)
@sentry/browser (incl. metrics) 26.5 KB (+0.29% 🔺)
@sentry/browser (incl. Feedback) 38.42 KB (0%)
@sentry/browser (incl. sendFeedback) 26.85 KB (0%)
@sentry/browser (incl. FeedbackAsync) 31.42 KB (0%)
@sentry/react 24.96 KB (0%)
@sentry/react (incl. Tracing) 36.35 KB (+0.1% 🔺)
@sentry/vue 26.32 KB (+0.37% 🔺)
@sentry/vue (incl. Tracing) 35.16 KB (+0.09% 🔺)
@sentry/svelte 22.35 KB (0%)
CDN Bundle 23.41 KB (0%)
CDN Bundle (incl. Tracing) 35.04 KB (+0.27% 🔺)
CDN Bundle (incl. Tracing, Replay) 69.17 KB (+0.14% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.34 KB (+0.12% 🔺)
CDN Bundle - uncompressed 68.76 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 103.61 KB (+0.2% 🔺)
CDN Bundle (incl. Tracing, Replay) - uncompressed 214.08 KB (+0.1% 🔺)
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 226.67 KB (+0.09% 🔺)
@sentry/nextjs (client) 36.23 KB (+0.1% 🔺)
@sentry/sveltekit (client) 33.95 KB (+0.14% 🔺)
@sentry/node 112.98 KB (+0.04% 🔺)
@sentry/node - without tracing 90.39 KB (+0.05% 🔺)
@sentry/aws-serverless 99.48 KB (+0.05% 🔺)

@mydea mydea merged commit 0019309 into develop Jun 20, 2024
113 checks passed
@mydea mydea deleted the fn/startSpanParent branch June 20, 2024 12:46
AbhiPrasad added a commit that referenced this pull request Jun 20, 2024
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.

Allow to create spans as children of specific spans
2 participants