Add CrewAI instrumentation: LLM inference event listener#224
Draft
venkata-pavani wants to merge 1 commit into
Draft
Add CrewAI instrumentation: LLM inference event listener#224venkata-pavani wants to merge 1 commit into
venkata-pavani wants to merge 1 commit into
Conversation
Ports the LLM-call slice of the donated OpenInference CrewAI instrumentation onto opentelemetry-util-genai: an event-bus listener converts LLMCallStarted/Completed/Failed events into chat inference invocations (usage tokens, response id, finish reasons, content capture). Tests: unit tests driving the listener with real CrewAI events, a VCR-backed Agent.kickoff() integration test, and a weaver conformance scenario - both replaying the genuinely-recorded inference cassette ported unchanged from open-telemetry/donation-openinference (commit 6cdd644d). The conformance tox env overrides crewai's opentelemetry-api pins via UV_OVERRIDE (tests/overrides-conformance.txt) so it can resolve against the git-pinned conformance stack. Known gap: CrewAI's event bus dispatches handlers on a thread pool, so util-genai's context attach/detach logs a ValueError per LLM call; fix requires an attach_context opt-out in util-genai (separate discussion). Assisted-by: Claude Fable 5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
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.
Ports the LLM-call slice of the donated OpenInference CrewAI instrumentation onto opentelemetry-util-genai: an event-bus listener converts LLMCallStarted/Completed/Failed events into chat inference invocations (usage tokens, response id, finish reasons, content capture).
Tests: unit tests driving the listener with real CrewAI events, a VCR-backed Agent.kickoff() integration test, and a weaver conformance scenario - both replaying the genuinely-recorded inference cassette ported unchanged from
open-telemetry/donation-openinference (commit 6cdd644d).
The conformance tox env overrides crewai's opentelemetry-api pins via UV_OVERRIDE (tests/overrides-conformance.txt) so it can resolve against the git-pinned conformance stack.
Known gap: CrewAI's event bus dispatches handlers on a thread pool, so util-genai's context attach/detach logs a ValueError per LLM call; fix requires an attach_context opt-out in util-genai (separate discussion).
Assisted-by: Claude Fable 5
Description
Please include a summary of the change and which issue, if any, is fixed.
Include the motivation and context for the change.
Fixes # (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. List any relevant details for your test
configuration.
Checklist
See CONTRIBUTING.md
for the style guide, changelog guidance, and more.