-
Notifications
You must be signed in to change notification settings - Fork 21
feat:add instrumentation mem0 #67
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
Conversation
Change-Id: Ifca2517d822c14a87fde2c6bcb39a13360c3ed21 Co-developed-by: Cursor <[email protected]>
Change-Id: I4fb5d565c4b1a22c7946193e25979339b07ab287 Co-developed-by: Cursor <[email protected]>
Change-Id: I61194a674d7f2bfb800b656b6f3cb86fad4cd155 Co-developed-by: Cursor <[email protected]>
Change-Id: I24e7730baca2e4363823b55780654a1104a88882 Co-developed-by: Cursor <[email protected]>
Change-Id: I1be20585e67d726b6690f7efc64bbf86c23ee077 Co-developed-by: Cursor <[email protected]>
Change-Id: I7d4a73207bce41f9c6880992b7a97c5957538498 Co-developed-by: Cursor <[email protected]>
Change-Id: I59d846db2d90c33b4573a7bcc2ff203983fa0023 Co-developed-by: Cursor <[email protected]>
Change-Id: I570e3f8ea4810890df3e05bf01868f1d063d9a66 Co-developed-by: Cursor <[email protected]>
Change-Id: Ibac64ce263d8d8f79f6909399e7af5779a866e18 Co-developed-by: Cursor <[email protected]>
instrumentation-loongsuite/loongsuite-instrumentation-mem0/pyproject.toml
Show resolved
Hide resolved
...oongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/__init__.py
Outdated
Show resolved
Hide resolved
...-loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/config.py
Show resolved
Hide resolved
...oongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/__init__.py
Outdated
Show resolved
Hide resolved
...loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/semconv.py
Outdated
Show resolved
Hide resolved
...instrumentation-mem0/src/opentelemetry/instrumentation/mem0/internal/_thread_pool_handler.py
Outdated
Show resolved
Hide resolved
...ongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/internal/_extractors.py
Show resolved
Hide resolved
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.
Pull request overview
This PR adds comprehensive instrumentation for Mem0, a memory management system for AI applications. The changes include a complete test suite with unit tests, integration tests, and VCR-based HTTP recording/playback tests to validate the instrumentation implementation.
Key changes:
- Adds tox test environment configuration for mem0 instrumentation
- Implements comprehensive test suite covering utility functions, metrics, extractors, configuration, and instrumentor functionality
- Includes VCR-based integration tests for both Memory and MemoryClient operations
- Provides test fixtures and configuration for OpenTelemetry span/metric/log collection
Reviewed changes
Copilot reviewed 46 out of 49 changed files in this pull request and generated 28 comments.
Show a summary per file
| File | Description |
|---|---|
| tox-loongsuite.ini | Adds test and lint environments for mem0 instrumentation |
| test_util.py | Tests for utility functions (string handling, type conversion, extraction) |
| test_thread_pool_handler.py | Tests for ThreadPool context propagation |
| test_metrics.py | Tests for metrics container and recording |
| test_memory_operations_vcr.py | VCR integration tests for Memory operations with fake dependencies |
| test_memory_operations_record_vcr.py | VCR integration tests using recorded HTTP cassettes |
| test_memory_client_vcr.py | VCR tests for MemoryClient (managed API) operations |
| test_memory_client_errors_vcr.py | VCR tests for HTTP error scenarios |
| test_instrumentor.py | Tests for instrumentation lifecycle and wrapping |
| test_extractors.py | Tests for attribute extraction from operations |
| test_config.py | Tests for configuration functions and environment variables |
| conftest.py | Shared fixtures, fake classes, and VCR configuration |
| cassettes/*.yaml | VCR cassettes for HTTP recording/playback |
| test-requirements.txt | Test dependencies specification |
| pytest-min.ini | Minimal pytest configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_vcr.py
Outdated
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_vcr.py
Outdated
Show resolved
Hide resolved
...tation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_record_vcr.py
Outdated
Show resolved
Hide resolved
...tation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_record_vcr.py
Outdated
Show resolved
Hide resolved
...tation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_record_vcr.py
Outdated
Show resolved
Hide resolved
...umentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_client_errors_vcr.py
Show resolved
Hide resolved
...umentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_client_errors_vcr.py
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_vcr.py
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_memory_operations_vcr.py
Show resolved
Hide resolved
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/test_thread_pool_handler.py
Outdated
Show resolved
Hide resolved
Change-Id: Iaea498e4ddf5cf822c7a3a590fbb8741a1a5c2be Co-developed-by: Cursor <[email protected]>
…/opentelemetry/instrumentation/mem0/__init__.py Co-authored-by: Minghui Zhang <[email protected]>
Change-Id: I324d7e152f097805dc3afabdbb33007b076aa1e5 Co-developed-by: Cursor <[email protected]>
Change-Id: Ic60c2d9f8abf076088cba61eae79e86ec1ba9502 Co-developed-by: Cursor <[email protected]>
Change-Id: Icfae8ed38f023aa35b96acaa2fadafcb8cafb728 Co-developed-by: Cursor <[email protected]>
Change-Id: I6360f9da62347262ef11d957ea698279ad64419a Co-developed-by: Cursor <[email protected]>
Change-Id: Idb0f2c6b3438a8fd9adc6a818b7e7c7e94f75d88 Co-developed-by: Cursor <[email protected]>
Change-Id: Ie4bc1f9aef0e62f37e5b98bc74247a6df00c6ed2 Co-developed-by: Cursor <[email protected]>
Change-Id: I2e6325995de5f52a0f4bac2db4a5f0e4c442821c Co-developed-by: Cursor <[email protected]>
Change-Id: I5b38076c88af14d3939a9e27e21aa051e02fe418 Co-developed-by: Cursor <[email protected]>
Change-Id: I759159f3e456b8707933fc01d69557bb1da6a0b4 Co-developed-by: Cursor <[email protected]>
Change-Id: Id5e98a6c31924de35913e06b8e7b26e07c1c4b15 Co-developed-by: Cursor <[email protected]>
Cirilla-zmh
left a comment
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.
Great PR! Several comments need to be resolved before merging this. Thanks!
instrumentation-loongsuite/loongsuite-instrumentation-mem0/pyproject.toml
Outdated
Show resolved
Hide resolved
...loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/semconv.py
Outdated
Show resolved
Hide resolved
...loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/package.py
Show resolved
Hide resolved
...loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/package.py
Outdated
Show resolved
Hide resolved
.../loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/internal/_wrapper.py
Outdated
Show resolved
Hide resolved
Change-Id: I75fc347cad09e33dc54c89ff480ad081884d3652 Co-developed-by: Cursor <[email protected]>
Cirilla-zmh
left a comment
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.
LGTM
instrumentation-loongsuite/loongsuite-instrumentation-mem0/pyproject.toml
Outdated
Show resolved
Hide resolved
...-loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/config.py
Show resolved
Hide resolved
...oongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/__init__.py
Outdated
Show resolved
Hide resolved
...ongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/internal/_extractors.py
Outdated
Show resolved
Hide resolved
Change-Id: Idf5110cfde8789737ab0f984ba7c36ac2eae151c Co-developed-by: Cursor <[email protected]>
.../loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/internal/_wrapper.py
Show resolved
Hide resolved
Change-Id: I7d122b5f2730d85bed1dc0619ba494f633649c40 Co-developed-by: Cursor <[email protected]>
123liuziming
left a comment
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.
LGTM
Change-Id: I5b5baa52398ca86ff3ee477e0920cc9531c02320 Co-developed-by: Cursor <[email protected]>
Description
This PR adds comprehensive instrumentation for Mem0, a memory management system for AI applications. The changes include a complete test suite with unit tests, integration tests, and VCR-based HTTP recording/playback tests to validate the instrumentation implementation.
Key changes:
Fixes #73
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.