send current span as parent-id for downstream services #3093
Unanswered
indolent-developer
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Is this for an outgoing request or an incoming request? Have you set either the |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there way to send current span as parent-id for downstream services.
I see code below but current span id is passed only if span is of type remote. What is way to send current span id to next downsteam service. This is needed so that we can co-relate logs.
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);
}
this._spanNotEnded.add(span);
return span;
}
https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L641-L650
Beta Was this translation helpful? Give feedback.
All reactions