A365SpanProcessor class
Copies relevant baggage entries to span attributes on span start.
This is the "automatic" counterpart to the manual scope API — it ensures every span in the pipeline gets agent identity attributes from baggage without explicitly creating scopes.
Methods
| force |
Force flush the processor. |
| on |
Called when a span is ended. |
| on |
Called when a span is started.
Copies relevant baggage entries to span attributes.
Only GenAI spans are processed (those with a known |
| shutdown() | Shutdown the processor. |
Method Details
forceFlush()
Force flush the processor.
function forceFlush(): Promise<void>
Returns
Promise<void>
onEnd(ReadableSpan)
Called when a span is ended.
function onEnd(_span: ReadableSpan)
Parameters
- _span
-
ReadableSpan
onStart(Span, Context)
Called when a span is started.
Copies relevant baggage entries to span attributes.
Only GenAI spans are processed (those with a known gen_ai.operation.name
span attribute: invoke_agent, execute_tool, chat, output_messages);
all other spans pass through unmodified.
function onStart(span: Span, parentContext?: Context)
Parameters
- span
-
Span
- parentContext
-
Context
shutdown()
Shutdown the processor.
function shutdown(): Promise<void>
Returns
Promise<void>