Skip to content

[OpenAI Agents Auto-Instrument] Auto-instrumented spans have hardcoded agent identity instead of actual agent details from baggage #134

Description

@fpfp100

Summary

Spans created by GenAISemanticProcessor use hardcoded default values for gen_ai.agent.name, gen_ai.agent.id, and gen_ai.agent.description instead of the actual agent identity propagated via baggage.

Details

Observed on auto-instrumented spans (chat, invoke_agent Assistant, unknown, Agent workflow):

Attribute Expected (from baggage) Actual (distro)
gen_ai.agent.name nikhilcagent0416 Agent User OpenAI Agent
gen_ai.agent.id d6d31512-379f-4994-b901-c098dfd9293f agent
gen_ai.agent.description agenticUser OpenAI Agents instrumentation

The base A365 SDK correctly propagates the real agent identity from baggage to all spans. The distro's GenAISemanticProcessor uses constructor defaults (agent_name, agent_id, agent_description) which are set at instrumentor init time, not from the per-request baggage context.

The invoke_agent Assistant span does correctly pick up the agent name "Assistant" from the AgentSpanData.name field, but gen_ai.agent.id and gen_ai.agent.description still show hardcoded defaults.

Expected behavior

Auto-instrumented spans should reflect the actual agent identity from baggage/context, matching the base A365 SDK behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions