Skip to content

Conversation

@fenilfaldu
Copy link
Contributor

@fenilfaldu fenilfaldu commented Jun 18, 2025

📥 Pull Request

closes #1082

📘 Description

  • Implemented wrappers for OpenAI's Chat Completions and Responses APIs to handle streaming responses, enabling telemetry data collection.
  • Introduced a new module for stream handling, including synchronous and asynchronous wrappers.
  • Improved error handling and logging for attribute extraction in various OpenAI API wrappers.
  • Refactored existing methods to streamline the instrumentation process and enhance code clarity.

🧪 Testing
Tested with example script.

@fenilfaldu fenilfaldu requested a review from dot-agi June 18, 2025 22:01
@dot-agi dot-agi requested a review from Copilot June 18, 2025 22:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements streaming support for OpenAI instrumentation while refactoring existing modules and updating error handling and telemetry logging. Key changes include:

  • Adding synchronous and asynchronous streaming wrappers for agent, workflow, tool, and team methods in the Agno instrumentation module.
  • Introducing a new Google ADK instrumentor and updating module import paths for various providers.
  • Revising documentation in the instrumentation README to reflect new streaming support and common module usage.

Reviewed Changes

Copilot reviewed 9 out of 129 changed files in this pull request and generated no comments.

Show a summary per file
File Description
agentops/instrumentation/agentic/google_adk/instrumentor.py New instrumentor with patching for Google ADK telemetry.
agentops/instrumentation/agentic/google_adk/init.py Exposes library info and instrumentor for Google ADK.
agentops/instrumentation/agentic/crewai/init.py New CrewAI instrumentation module initialization.
agentops/instrumentation/agentic/agno/instrumentor.py Extensive updates to support streaming via new wrapper parameters.
agentops/instrumentation/agentic/agno/init.py Updated Agno library information and version management.
agentops/instrumentation/agentic/ag2/init.py New AG2 instrumentation module with updated library info.
agentops/instrumentation/agentic/ag2/init.py (deleted version) Removal of legacy AG2 instrumentation file.
agentops/instrumentation/init.py Updates to module paths and provider configurations.
agentops/instrumentation/README.md Revised documentation with usage examples and best practices.

@fenilfaldu
Copy link
Contributor Author

Stale

@fenilfaldu fenilfaldu closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Token Usage Extraction Across OpenAI API Endpoints

3 participants