Skip to content

Add GenAI memory span instrumentation#4215

Draft
nagkumar91 wants to merge 1 commit intoopen-telemetry:mainfrom
nagkumar91:nag/pr3250-memory-semconv-genai
Draft

Add GenAI memory span instrumentation#4215
nagkumar91 wants to merge 1 commit intoopen-telemetry:mainfrom
nagkumar91:nag/pr3250-memory-semconv-genai

Conversation

@nagkumar91
Copy link
Copy Markdown
Contributor

@nagkumar91 nagkumar91 commented Feb 18, 2026

Summary

Implements LangChain retriever memory-search instrumentation aligned with the
GenAI memory semantic-convention proposal in
open-telemetry/semantic-conventions#3250.

What changed

  • Added retriever memory-search instrumentation in
    opentelemetry-instrumentation-langchain:
    • emits search_memory operation telemetry for memory retrievers
    • records memory store/query/result-count attributes
    • handles retriever start/end/error lifecycle via the shared GenAI handler
  • Added/updated LangChain unit tests and changelog entry.

Related PRs

How has this been tested?

  • pytest -q instrumentation-genai/opentelemetry-instrumentation-langchain/tests/test_callback_handler_memory.py

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nagkumar91 nagkumar91 force-pushed the nag/pr3250-memory-semconv-genai branch from 1d607d6 to 411beb7 Compare February 24, 2026 17:51
@nagkumar91 nagkumar91 marked this pull request as draft March 2, 2026 16:03
@nagkumar91
Copy link
Copy Markdown
Contributor Author

Spec update: gen_ai.memory.type removed

FYI — we've removed gen_ai.memory.type from the semantic conventions spec (open-telemetry/semantic-conventions#3250, commit e2aabf7b).

Only Azure AI Foundry natively exposes memory types. Since LangChain doesn't expose memory types at the API level, this attribute should be removed from the instrumentation code in this PR.

Please update to stop emitting gen_ai.memory.type on memory spans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

7 participants