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

[Node] Refactor SpanExporter to use getSpanDescendants() #12510

Closed
mydea opened this issue Jun 17, 2024 · 0 comments · Fixed by #12610
Closed

[Node] Refactor SpanExporter to use getSpanDescendants() #12510

mydea opened this issue Jun 17, 2024 · 0 comments · Fixed by #12610
Assignees
Labels
Package: node Issues related to the Sentry Node SDK Package-Meta: OpenTelemetry

Comments

@mydea
Copy link
Member

mydea commented Jun 17, 2024

Today, we keep all finished spans in the span exporter and build the span tree from there to send the spans as a single transactionEvent.

With changes we did in the v8 cycle, we can actually simplify this a lot - we can simply ignore all non-root spans in the span exporter, and generate the transactionEvent payload (spans) via getSpanDescendants(rootSpan) - we already keep track of the children there, so we may as well use this.

With this, we can simplify the exporter code a lot, and also remove handling around memory leaks - no need to keep a list of child spans in the exporter and clean it up.

Initially, let's drop any child spans that are not finished - we may revisit this later, but this is the easiest thing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK Package-Meta: OpenTelemetry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants