Add CrewAI instrumentation#4860
Closed
srinjoy356 wants to merge 3 commits into
Closed
Conversation
Adds a new instrumentation package for CrewAI, built on opentelemetry-util-genai per the GenAI instrumentation review rules: invoke_workflow/invoke_agent/chat/execute_tool spans via TelemetryHandler, agent-to-agent handoffs as span links rather than parent-child spans, and all six of CrewAI's independent LLM call paths patched. Also fixes ToolInvocation._apply_finish in opentelemetry-util-genai itself: tool_result was set as a field but never serialized onto the span, and arguments/tool_result were passed through as raw Python values instead of JSON-encoded, which crashes span attribute validation for non-primitive values. Both needed for this instrumentation's tool spans to actually carry a result. Fixes open-telemetry#4859 Assisted-by: Claude Sonnet 5
Assisted-by: Claude Sonnet 5
Contributor
|
Thanks for your work but the genai work has been moved to the genai-python repository, the new instrumentations are tracked in this issue open-telemetry/opentelemetry-python-genai#141 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new instrumentation package for CrewAI (multi-agent LLM orchestration),
built on opentelemetry-util-genai. Also includes a small fix to
ToolInvocation._apply_finish in the util itself — tool_result was set as a
field but never surfaced onto the span, and non-primitive values (dicts,
etc.) for arguments/tool_result crashed span attribute validation since they
weren't JSON-encoded. Both needed for this instrumentation's tool spans to
actually carry a result.
Addresses the gap described in SigNoz/signoz#11663 (opened in a different
repo, so not linked as a closing keyword there).
Fixes #4859
Type of change
How Has This Been Tested?
exception handling, handoff-link logic, and two concurrency tests for
overlapping/back-to-back LLM calls on a shared instance).
confirming the actual span hierarchy and a real handoff link.
Does This PR Require a Core Repo Change?
Checklist: