Skip to content

[Bug]: OpenAI agent chat traces don't contain input/output messages and other fields #167

Closed

Description

Component

General

Description

For agents using openai python package, the chat traces show up when setting the following env vars:

os.environ.setdefault("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT", "SPAN_AND_EVENT")
os.environ.setdefault("OTEL_SEMCONV_STABILITY_OPT_IN", "gen_ai_latest_experimental")

But these chat traces don't contain the following 4 GenAI fields:

gen_ai.input.messages
gen_ai.output.messages
gen_ai.tool.definitions
gen_ai.system_instructions

These fields are vital to debug agents using LLMs.

I've tried my experiments with a version of this sample agent that's the repo: https://github.com/microsoft/opentelemetry-distro-python/blob/9d3b25fa48c8bbd283203aa1757a0aa774458ff7/samples/openai/sample_openai_agents.py

Expected Behavior

Chat traces from openai agents should populate the following 4 GenAI fields:

gen_ai.input.messages
gen_ai.output.messages
gen_ai.tool.definitions
gen_ai.system_instructions

Steps to Reproduce

Use the repo agent with app insights: https://github.com/microsoft/opentelemetry-distro-python/blob/9d3b25fa48c8bbd283203aa1757a0aa774458ff7/samples/openai/sample_openai_agents.py

Environment

Hosted Agent on Foundry

Additional Context

No response

Activity

  1. rads-1996 commented on May 27, 2026

    @rads-1996
    Member

    shivam mamgain (@shivamMg) Can you please share a screenshot of how you are configuring the microsoft distro?

  2. github-actions commented on May 29, 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-05-29.

  3. github-actions commented on Jun 6, 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.

  4. github-actions commented on Jun 13, 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

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions