Skip to content

[Bug]: LangGraph agents in Foundry Hosted agents are not emitting gen_ai.agent.* metadata #225

Closed

Description

Component

Langchain

Description

LangGraph/LangChain agents that are being run inside Microsoft Foundry as Hosted agents are not emitting Agent name, version and id in the right fields.

Instead of emitting them in the fields dictated by OTel GenAI Semconv. Instead of these fields:

gen_ai.agent.name
gen_ai.agent.version
gen_ai.agent.id

The following fields are being set:

microsoft.gen_ai.main_agent.name
microsoft.gen_ai.main_agent.version
microsoft.gen_ai.main_agent.id

Expected Behavior

The following fields are not being set for langgraph agents:

gen_ai.agent.name
gen_ai.agent.version
gen_ai.agent.id

Steps to Reproduce

Try the sample LangGraph agent from: https://github.com/shivamMg/fine-tuning/tree/d49b6e462db7f3795a7eb8984aa8900a03780b42/Demos/AgentTracesToSFT/retail-agent-langgraph

Environment

Microsoft Foundry Hosted agents

Additional Context

No response

Activity

  1. changed the title [-][Bug]: LangGraph agent in Foundry Hosted agents not emitting gen_ai.agent.* metadata[/-] [+][Bug]: LangGraph agents in Foundry Hosted agents are not emitting gen_ai.agent.* metadata[/+] on Jul 16, 2026
  2. rads-1996 commented on Jul 16, 2026

    @rads-1996
    Member

    shivam mamgain (@shivamMg) I think I know what is wrong here, in your sample when you invoke the microsoft distro, you pass the agent_id, name and description as config parameters to the distro instead of passing it in the instrumentation options for langchain -

    Image

    You should instead be passing these values as follows -

    use_microsoft_opentelemetry(
        enable_azure_monitor=True,
        sampling_ratio=1.0,
        instrumentation_options={
            "langchain": {
                "enabled": True,
                # Optional: set static agent identity on all LangChain spans.
                # These appear as gen_ai.agent.* attributes in your telemetry.
                # If omitted, agent_name is inferred from LangChain's
                # runtime metadata when available.
                agent_name=os.getenv("AGENT_NAME", "retail-agent-langgraph"),
                agent_version=os.getenv("AGENT_VERSION"),
                agent_id=os.getenv("AGENT_ID"),
            },
        },
        enable_sensitive_data=True,
    )
    

    Please try out the correct format and let us know if the issue persists.

  3. github-actions commented on Jul 16, 2026

    @github-actions

    shivam mamgain (@shivamMg) we need more information before we can continue working on this issue.

    Please reply within 14 days. If we do not hear back, this issue may be closed automatically.

    Marked as needs-author-feedback on 2026-07-16.

  4. github-actions commented on Jul 24, 2026

    @github-actions

    shivam mamgain (@shivamMg) friendly reminder: we are still waiting for your feedback.

    If we do not hear back within 7 more days, this issue may be closed automatically.

  5. github-actions commented on Jul 31, 2026

    @github-actions

    shivam mamgain (@shivamMg) we have not received the requested information within 14 days, so we are closing this issue for now.

    If you still need help, please comment with the requested details and we can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions