Add GenAI memory span instrumentation#4215
Open
nagkumar91 wants to merge 5 commits intoopen-telemetry:mainfrom
Open
Add GenAI memory span instrumentation#4215nagkumar91 wants to merge 5 commits intoopen-telemetry:mainfrom
nagkumar91 wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
Implement PR 3250 memory operation coverage in openai-agents-v2 and langchain, including memory span attributes and retriever memory search telemetry tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…conv-genai # Conflicts: # instrumentation-genai/opentelemetry-instrumentation-langchain/CHANGELOG.md
…ch_memory' LangChain's retriever abstraction is generic — it covers both RAG/vector DB search and memory retrieval. Defaulting all retrievers to search_memory was incorrect for non-memory retrievers. Now: - Default operation is 'retrieval' for all retrievers - Only use 'search_memory' when metadata explicitly indicates memory (memory_store_name, memory_store_id, or is_memory_retriever flag) - Memory attributes (gen_ai.memory.*) are still attached when present Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Feb 23, 2026
- Suppress reportUnknownArgumentType/reportUnknownVariableType on serialized_id list join (type comes from untyped dict[str, Any]) - Remove unnecessary isinstance(query, str) check — query param is already typed as str in on_retriever_start signature Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Implements the GenAI memory operation semantic conventions proposed in
open-telemetry/semantic-conventions#3250 for Python contrib instrumentations.
What changed
search_memory,update_memory,delete_memory,create_memory_store,delete_memory_storeopentelemetry-instrumentation-langchain:search_memoryoperation telemetryRelated PRs
How has this been tested?
Type of change
Does This PR Require a Core Repo Change?
Checklist