Skip to content

Conversation

@fenilfaldu
Copy link
Contributor

📥 Pull Request

📘 Description
Previously, concurrent.futures was being instrumented globally whenever any provider or agentic library was imported. This caused unnecessary overhead and potential conflicts as the ThreadPoolExecutor instrumentation was applied universally, even when not needed.

This PR introduces a dependency-based instrumentation system that restricts concurrent.futures instrumentation to only activate when specific packages that require it are being used.

  • Added UTILITY_DEPENDENCIES mapping defines which packages require which utility instrumentors.
  • Currently maps mem0 to require concurrent.futures instrumentation.

🧪 Testing
Example

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agentops/instrumentation/__init__.py 55.55% 24 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Dwij1704 Dwij1704 self-requested a review July 1, 2025 15:48
Copy link
Member

@Dwij1704 Dwij1704 left a comment

Choose a reason for hiding this comment

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

GG

@Dwij1704 Dwij1704 merged commit dc56fb2 into main Jul 1, 2025
9 checks passed
@Dwij1704 Dwij1704 deleted the concurrent_fix branch July 1, 2025 18:02
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.

3 participants