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

Convert span to ReadableSpan before sending to span processor

Open obecny opened this issue 4 years ago • 16 comments
trafficstars

Currently when Span ends it sends the whole self to the span processor. Span Processor expects the span to be ReadableSpan but in fact the span that is being sent is a whole object with methods etc. I think we should send only an object in correct format. We could have for example a private function "_serialize" or "_toReadableSpan" which will send only required data and nothing more. We should also think about sealing the data so it cannot be modified. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#interface-definition

obecny avatar Feb 04 '21 17:02 obecny