opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Controlling parent-id being send to downstream services

Open indolent-developer opened this issue 3 years ago • 1 comments
trafficstars

  • [ ] 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.

indolent-developer avatar Jul 14 '22 10:07 indolent-developer

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.

github-actions[bot] avatar Sep 19 '22 06:09 github-actions[bot]

This issue was closed because it has been stale for 14 days with no activity.

github-actions[bot] avatar Oct 10 '22 06:10 github-actions[bot]