MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / addSpanChildren

Function addSpanChildren

packages/core/src/utils/spanUtils.ts:400–412  ·  view source on GitHub ↗
(span: SpanWithPotentialChildren)

Source from the content-addressed store, hash-verified

398 const resultSet = new Set<Span>();
399
400 function addSpanChildren(span: SpanWithPotentialChildren): void {
401 // This exit condition is required to not infinitely loop in case of a circular dependency.
402 if (resultSet.has(span)) {
403 return;
404 // We want to ignore unsampled spans (e.g. non recording spans)
405 } else if (spanIsSampled(span)) {
406 resultSet.add(span);
407 const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : [];
408 for (const childSpan of childSpans) {
409 addSpanChildren(childSpan);
410 }
411 }
412 }
413
414 addSpanChildren(span);
415

Callers 1

getSpanDescendantsFunction · 0.85

Calls 4

spanIsSampledFunction · 0.85
hasMethod · 0.65
addMethod · 0.65
fromMethod · 0.45

Tested by

no test coverage detected