Repository navigation
Propogate a span across micro services #5231
Replies: 1 comment
|
You cannot resume the same On the receiving side, extract the propagated context and start a new span with it as parent: const parentContext = propagation.extract(ROOT_CONTEXT, incomingHeaders);
await tracer.startActiveSpan('service.operation', {}, parentContext, async span => {
try {
await doWork();
} finally {
span.end();
}
});A plain References: Span and SpanContext model, JavaScript context propagation. |
Uh oh!
There was an error while loading. Please reload this page.
I have a use case where I want to start a span for a trace in one service and then, without closing the span, navigate to a second service (used window.location.href for navigation). In the second service, I want to resume the existing span and close it there, rather than creating a child span. While I know how to propagate a trace across services using the traceparent, I want to know if it is possible to propagate a span as well.
All reactions