@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
    • Flushes pending work. No-op for this processor.

      Returns Promise<void>

    • When a span is itself a top-level invoke_agent operation that has not already been enriched, copies its gen_ai.agent.* / gen_ai.conversation.id attributes onto the microsoft.gen_ai.main_agent.* keys.

      Parameters

      • span: ReadableSpan

        The span that has ended.

      Returns void

    • Copies main-agent attributes from the parent span (or its gen_ai.agent.* fallbacks) onto a span when it starts.

      Parameters

      • span: Span

        The span that is starting.

      • parentContext: Context

        The context containing the parent span, if any.

      Returns void

    • Shuts down the processor. No-op for this processor.

      Returns Promise<void>