Skip to content

fix(crewai): inherit agent context on OpenAI-v2 chat spans and metrics#205

Merged
adityamehra merged 1 commit intosignalfx:mainfrom
adityamehra:fix/crewai-openai-v2-agent-inheritance-clean
Feb 20, 2026
Merged

fix(crewai): inherit agent context on OpenAI-v2 chat spans and metrics#205
adityamehra merged 1 commit intosignalfx:mainfrom
adityamehra:fix/crewai-openai-v2-agent-inheritance-clean

Conversation

@adityamehra
Copy link
Copy Markdown
Contributor

@adityamehra adityamehra commented Feb 11, 2026

Summary

  • switch CrewAI instrumentation to use get_telemetry_handler(...) so CrewAI and OpenAI-v2 share the same singleton handler/context
  • update CrewAI singleton tests to validate singleton retrieval behavior and reset the handler singleton between tests
  • add test_openai_v2_inheritance.py to verify OpenAI-v2-style chat spans and chat metrics inherit gen_ai.agent.* from CrewAI agent execution

Agent name on metric

image

agent name attribute on chat spans from OpenAI

image

Made with Cursor

@adityamehra adityamehra requested review from a team as code owners February 11, 2026 00:30
@pradystar pradystar self-requested a review February 11, 2026 18:29
Copy link
Copy Markdown
Contributor

@pradystar pradystar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix lint issues. The changes looks fine.

@adityamehra adityamehra force-pushed the fix/crewai-openai-v2-agent-inheritance-clean branch from 02d9ca8 to 5b0bf1d Compare February 20, 2026 18:19
@adityamehra adityamehra merged commit 57017a9 into signalfx:main Feb 20, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants