-
Notifications
You must be signed in to change notification settings - Fork 29
feat: Add native Crew AI instrumentation support #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a059c3e to
84bdeaa
Compare
| Note: Semantic conventions may change in future versions. | ||
| """ | ||
|
|
||
| def instrumentation_dependencies(self) -> Collection[str]: # pylint: disable=no-self-use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the method useful?
| from crewai.tools.structured_tool import CrewStructuredTool | ||
| from crewai.tools.tool_calling import ToolCalling | ||
| from crewai.tools.tool_usage import ToolUsage | ||
| from pydantic import BaseModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pydantic might be architecture incompatibility, bring in trouble if we want to support one-click enablement. Is it required?
| GEN_AI_TOOL_DEFINITIONS, | ||
| GEN_AI_TOOL_DESCRIPTION, | ||
| GEN_AI_TOOL_NAME, | ||
| GEN_AI_TOOL_TYPE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these except GEN_AI_PROVIDER_NAME, GEN_AI_SYSTEM_INSTRUCTIONS, GEN_AI_TOOL_CALL_ARGUMENTS, GEN_AI_TOOL_CALL_RESULT, and.GEN_AI_TOOL_DEFINITIONS are available in the 1.33.1/0.54b1 version of Otel we depend on.
P.S we should do an Otel version bump (see nightly build) to get the latest version of opentelemetry-semantic-coonventions where all of these attributes are available.
| "claude": "anthropic", | ||
| "azure": "azure.ai.openai", | ||
| "azure_openai": "azure.ai.openai", | ||
| "google": "gcp.vertex_ai", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcp.vertex_ai should be the mapping for Vertex AI specifically. gcp.gen_ai is the generic Google fallback per https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-metrics/
Description of changes:
Adds native OTel instrumentation for CrewAI following OTel's Gen's AI Agent semantic conventions 1.39
Instruments and wraps
Crew.kickoff,Task._execute_core, and ToolUsage._usemethods to generate spans that capture the execution cycle of agentic workflows.Add auto-wiring using OTel's entry points system, so applications using ADOT Python auto-instrumentation will automatically trace CrewAI workflows without any code changes.
Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.