Skip to content

fix(otel): Don't ignore child spans after the root is sent #16416

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

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

BYK
Copy link
Member

@BYK BYK commented May 28, 2025

This fixes a critical issue I was having with Mastra where almost all my spans from a workflow run were getting stuck due to their parent span being sent almost immediately. I'm guessing this has to do something with async stuff going on. Regardless, by treating these children as 'root spans' I was able to get them out and displayed correctly in Spotlight.

What this does is creates a 5-min capped 'already sent span ids' cache and treats any span that has a parent id in this list as a root span to get them unstuck.

image

This fixes a critical issue I was having with Mastra where almost all my spans from a workflow run were getting stuck due to their parent span being sent almost immediately. I'm guessing this has to do something with `async` stuff going on. Regardless, by treating these children as 'root spans' I was able to get them out and displayed correctly in Spotlight.

What this does is creates a 5-min capped 'already sent span ids' cache and treats any span that has a parent id in this list as a root span to get them unstuck.
@BYK BYK requested review from mydea and AbhiPrasad May 28, 2025 19:01
Copy link
Contributor

github-actions bot commented May 28, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB - -
@sentry/browser - with treeshaking flags 23.76 kB - -
@sentry/browser (incl. Tracing) 38.29 kB - -
@sentry/browser (incl. Tracing, Replay) 76.43 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.55 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 81.19 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 93.27 kB - -
@sentry/browser (incl. Feedback) 40.73 kB - -
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.59 kB - -
@sentry/react 25.76 kB - -
@sentry/react (incl. Tracing) 40.29 kB - -
@sentry/vue 28.34 kB - -
@sentry/vue (incl. Tracing) 40.13 kB - -
@sentry/svelte 24.01 kB - -
CDN Bundle 25.31 kB - -
CDN Bundle (incl. Tracing) 38.47 kB - -
CDN Bundle (incl. Tracing, Replay) 74.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 79.75 kB - -
CDN Bundle - uncompressed 73.9 kB - -
CDN Bundle (incl. Tracing) - uncompressed 113.88 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 227.85 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.67 kB - -
@sentry/nextjs (client) 41.96 kB - -
@sentry/sveltekit (client) 38.79 kB - -
@sentry/node 150.03 kB +0.11% +164 B 🔺
@sentry/node - without tracing 98.28 kB +0.17% +161 B 🔺
@sentry/aws-serverless 124.05 kB +0.15% +174 B 🔺

View base workflow run

@AbhiPrasad AbhiPrasad requested a review from andreiborza May 28, 2025 19:48
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.

1 participant