You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(opentelemetry): Stop looking at propagation context for span creation (#14481)
This PR changes the behavior of the OTEL-based Node SDK to ignore the
propagation context when starting spans.
Previously, when you called `startSpan` and there was no incoming trace,
we would ensure that the new span has the trace ID + span ID from the
propagation context.
This has a few problems:
1. Multiple parallel root spans will continue the same virtual trace,
instead of having separate traces.
2. This is really invalid in OTEL, as we have to provide a span ID and
cannot really tell it to use a specific trace ID out of the box. Because
of this, we had to add a bunch of special handling to ensure we can
differentiate real and fake parent span IDs properly.
This PR fixes this by simply not looking at this anymore. For TWP and
error marking the propagation context is still used as before, only for
new spans is there a difference.
I also added docs explaining how trace propagation in node works now:

Copy file name to clipboardExpand all lines: dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/scenario.ts
Copy file name to clipboardExpand all lines: dev-packages/node-integration-tests/suites/public-api/startSpan/parallel-spans-in-scope-with-parentSpanId/test.ts
+12-21
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,19 @@ afterAll(() => {
6
6
7
7
test('should send manually started parallel root spans outside of root context with parentSpanId',done=>{
0 commit comments