@ottrelite/interop-otel.DevSpanProcessorInterceptor
OTEL SpanProcessor implementation that intercepts spans live and passes them to Ottrelite's Development API.
This is useful for development and debugging purposes, allowing you to live-trace using compatible backends and see the events in real-time without needing to export them to a backend, nor (usually) have an infrastructure.
Example backends that are meant to be used with this processor are: @ottrelite/backend-platform
, @ottrelite/backend-wrapper-tracy
.
This class uses the asynchronous Ottrelite API to functionally match OTEL's async-capable tracing API.
SpanProcessor
new DevSpanProcessorInterceptor()
Protected
spanToInternalTokenMapping: WeakMap
<Span
, number
>
Maps OTEL Span objects to internal Ottrelite API tokens in the async tracing API. This is needed to match OTEL's async-aware API.
forceFlush(): Promise
<void
>
Promise
<void
>
SpanProcessor.forceFlush
onEnd(span
): void
Name | Type |
---|---|
span | Span |
void
SpanProcessor.onEnd
onStart(span
): void
Name | Type |
---|---|
span | Span |
void
SpanProcessor.onStart
shutdown(): Promise
<void
>
Promise
<void
>
SpanProcessor.shutdown