Repository navigation
feat(attributes): Add gen_ai memory conventions - #653
Merged
Merged
Conversation
Adopt the OTel GenAI memory conventions (open-telemetry/semantic-conventions-genai#140): - Add gen_ai.memory.{store.id,record.id,record.count,query.text,records} - Add memory values (and missing upstream values) to gen_ai.operation.name - Add 'memory' to gen_ai.operation.type - Add gen_ai.memory.client span op and Memory name/description groups Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
Internal Changes 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
ArthurKnaus
marked this pull request as ready for review
September 28, 2026 08:27
ArthurKnaus
requested review from
a team,
Lms24,
cleptric,
mjq and
nsdeschenes
as code owners
September 28, 2026 08:27
alexander-alderman-webb
left a comment
Contributor
There was a problem hiding this comment.
The memory stuff is good.
I'm not sure we want to copypasta all OTel ops since there's a huge variety of GenAI spans allowed by OTel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexander-alderman-webb
approved these changes
Sep 28, 2026
alexander-alderman-webb
left a comment
Contributor
There was a problem hiding this comment.
Thanks for responding!
As always, wait a few days before merging to folks can have a look.
ArthurKnaus
enabled auto-merge (squash)
October 6, 2026 09:09
4 tasks
4 tasks done
2 of 6 tasks
ArthurKnaus
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Oct 13, 2026
Document the `gen_ai.memory.client` span in the agent tracing manual instrumentation guides, modeled on the existing evaluation span docs. Follows [sentry-conventions#653](getsentry/sentry-conventions#653), which adds the `gen_ai` memory operations, the `memory` operation type, and the `gen_ai.memory.*` attributes. - Add a "Memory Span" section to the JavaScript and Python manual instrumentation pages, with a `search_memory` example and prose covering the other operation names (`create_memory`, `update_memory`, `upsert_memory`, `delete_memory`, `create_memory_store`, `delete_memory_store`) - Add a shared `memory-span` attributes include (store/record identifiers, record count, and the opt-in query/records content)
This branch was successfully deployed
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.
Description
Closes TET-3039
Adds memory coverage to the
gen_ainamespace for TET-2920 (memory capture events in the conversation transcript). Everything here comes from the OTel GenAI memory conventions (open-telemetry/semantic-conventions-genai#140), exceptgen_ai.operation.type, which is Sentry-only.New attributes (
is_in_otel: true,apply_scrubbing: manual)gen_ai.memory.store.id: the memory store the operation targets. What it maps to depends on the implementation.gen_ai.memory.record.id: a single memory record. Ondelete_memory, a missing id may mean every record in the store is deleted.gen_ai.memory.record.count: records returned (search) or records the operation attempted to write or delete.gen_ai.memory.query.text: the search query. Opt-in.gen_ai.memory.records: the records themselves as a stringified JSON array following OTel's MemoryRecord schema. Opt-in. It's a string rather than OTel'sany, the same way we handlegen_ai.input.messages.Updated attributes
gen_ai.operation.name: addscreate_memory_store,delete_memory_store,create_memory,update_memory,upsert_memory,search_memoryanddelete_memory.gen_ai.operation.type: addsmemoryforgen_ai.memory.clientspans, so the UI can query them instead of lumping them intoother.Span op / name / description
gen_ai.memory.client. The specific action goes ingen_ai.operation.name.Memorygroup inmodel/name/gen_ai.jsonandmodel/description/gen_ai.json. The template is{{gen_ai.operation.name}}, following OTel's span name rule.PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)apply_scrubbing(i.e.manualorauto. Useneveronly for values that should never be scrubbed such as IDs)🤖 Generated with Claude Code