Add OpenTelemetry instrumentation for CrewAI#87
Open
whoIam0987 wants to merge 14 commits intoalibaba:mainfrom
Open
Add OpenTelemetry instrumentation for CrewAI#87whoIam0987 wants to merge 14 commits intoalibaba:mainfrom
whoIam0987 wants to merge 14 commits intoalibaba:mainfrom
Conversation
13a39ef to
aa5f9e1
Compare
Collaborator
|
Thanks for the contribution! Please fix the CI failure. |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds OpenTelemetry instrumentation for the CrewAI framework, enabling automatic tracing of Crew, Agent, Task, and Tool executions with GenAI semantic conventions.
Changes:
- Implements OpenTelemetry instrumentation wrappers for CrewAI's core components (Crew, Flow, Agent, Task, and Tool)
- Adds utility functions for JSON serialization and message conversion to GenAI format
- Includes comprehensive test suite covering synchronous/streaming LLM calls, tool usage, error scenarios, and agent workflows
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
src/opentelemetry/instrumentation/crewai/__init__.py |
Main instrumentation module with wrapper classes for Crew.kickoff, Flow.kickoff_async, Agent.execute_task, Task.execute_sync, and ToolUsage._use |
src/opentelemetry/instrumentation/crewai/utils.py |
Utility functions for JSON serialization, message conversion, and GenAI hook helpers |
src/opentelemetry/instrumentation/crewai/package.py |
Package metadata defining instrumentation dependencies |
src/opentelemetry/instrumentation/crewai/version.py |
Version information (0.1.0) |
pyproject.toml |
Project configuration with dependencies and build settings |
README.md |
Documentation with installation instructions and usage examples |
test-requirements.txt |
Test dependencies including CrewAI >=0.80.0 and LiteLLM |
tests/*.py |
Comprehensive test suite covering various CrewAI execution scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
instrumentation-loongsuite/loongsuite-instrumentation-crewai/pyproject.toml
Outdated
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-crewai/pyproject.toml
Outdated
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Outdated
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-crewai/pyproject.toml
Outdated
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Outdated
Show resolved
Hide resolved
...suite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/__init__.py
Show resolved
Hide resolved
...ongsuite/loongsuite-instrumentation-crewai/src/opentelemetry/instrumentation/crewai/utils.py
Outdated
Show resolved
Hide resolved
ea54b36 to
bdd8765
Compare
ralf0131
approved these changes
Feb 11, 2026
Cirilla-zmh
reviewed
Feb 13, 2026
instrumentation-loongsuite/loongsuite-instrumentation-crewai/test-requirements.txt
Outdated
Show resolved
Hide resolved
ac3699a to
87bd43f
Compare
2 change unit test to adapt code.
Disable the eval function and modify some version information; Add a changelog.
Adjusted the test-requirements.txt.
Add crewai tests to GitHub workflow.
2 The CHANGELOG.md file has been added; 3 Metric is not supported.
45264b2 to
42e177a
Compare
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
Instrument CrewAI with genai util.
Fixes #58 (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.