I would like to determine if the parent span (if it exists) is Remote, given a ReadableSpan. This information is needed in my implementation of a SpanExporter's export function.
ReadableSpan is the only information provided when implementing the Export functionality of SpanExporter. (see ConsoleExporter)
In Python and Java, this is easy. We can get the parent span from the current span, then check the contex's isRemote value.
I would like to determine if the parent span (if it exists) is Remote, given a
ReadableSpan
. This information is needed in my implementation of a SpanExporter's export function.ReadableSpan
is the only information provided when implementing theExport
functionality of SpanExporter. (see ConsoleExporter)In Python and Java, this is easy. We can get the parent span from the current span, then check the contex's
isRemote
value.However, in JS, the
ReadableSpan
span only provides the parent's Id: https://github.com/open-telemetry/opentelemetry-js/blob/0f6363ae357491430c4e0afdc6672e9dae57f2bd/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts#L33If we are able to get a span given an Id, this would help, but I haven't found a way to get a span given a span Id in the OTel JavaScript APIs.
Is there a workaround, or can OTel JS be updated to be able to get the parent span context given a ReadableSpan?