opentelemetry-js
opentelemetry-js copied to clipboard
Controlling parent-id being send to downstream services
- [ ] This only affects the JavaScript OpenTelemetry library
- [ x] This may affect other libraries, but I would like to get opinions here first
Hi,
I see this code here.
if (requireParent === true && currentSpan === undefined) { span = trace.wrapSpanContext(INVALID_SPAN_CONTEXT); } else if (requireParent === true && currentSpan?.spanContext().isRemote) { span = currentSpan; } else { span = this.tracer.startSpan(name, options, ctx); }
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L641-L650
So currently there is no way to send current span as parent-id to downstream services ? I think it would be good idea to re-use current span id to send downstream stream instead of creating a new one.
This will allow for better co-relation between span on server side and client side. I want to use the same same span id as parent-id . Please let me know how this can be made possible.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stale for 14 days with no activity.