@microsoft/opentelemetry
    Preparing search index...

    Class GenAIMainAgentSpanProcessor

    Propagates microsoft.gen_ai.main_agent.* attributes onto spans.

    • onStart: copies main-agent attributes from the parent span (or falls back to the parent's gen_ai.agent.* / gen_ai.conversation.id attributes) onto the new span.
    • onEnd: when the span is itself an invoke_agent operation and has not already been enriched, copies its own gen_ai.agent.* / gen_ai.conversation.id attributes onto microsoft.gen_ai.main_agent.* so the top-level agent identifies itself as the main agent.

    Implements

    • SpanProcessor
    Index

    Constructors

    Methods

    • Forces to export all finished spans

      Returns Promise<void>

    • Called when a ReadableSpan is ended, if the span.isRecording() returns true.

      Parameters

      • span: ReadableSpan

        the Span that just ended.

      Returns void

    • Called when a Span is started, if the span.isRecording() returns true.

      Parameters

      • span: Span

        the Span that just started.

      • parentContext: Context

      Returns void

    • Shuts down the processor. Called when SDK is shut down. This is an opportunity for processor to do any cleanup required.

      Returns Promise<void>