Skip to content

feat(attributes): Add gen_ai memory conventions - #653

Merged
ArthurKnaus merged 6 commits into
mainfrom
feat/gen-ai-memory-conventions
Oct 7, 2026
Merged

ArthurKnaus merged 6 commits into
mainfrom
feat/gen-ai-memory-conventions

Conversation

@ArthurKnaus

@ArthurKnaus ArthurKnaus commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Description

Closes TET-3039

Adds memory coverage to the gen_ai namespace 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), except gen_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. On delete_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's any, the same way we handle gen_ai.input.messages.

Updated attributes

  • gen_ai.operation.name: adds create_memory_store, delete_memory_store, create_memory, update_memory, upsert_memory, search_memory and delete_memory.
  • gen_ai.operation.type: adds memory for gen_ai.memory.client spans, so the UI can query them instead of lumping them into other.

Span op / name / description

  • New op gen_ai.memory.client. The specific action goes in gen_ai.operation.name.
  • New Memory group in model/name/gen_ai.json and model/description/gen_ai.json. The template is {{gen_ai.operation.name}}, following OTel's span name rule.

PR Checklist

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • The attribute is in a namespace (e.g. nextjs.function_id, not function_id)
  • I have used the correct value for apply_scrubbing (i.e. manual or auto. Use never only for values that should never be scrubbed such as IDs)

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-conventions Ready Ready Preview Oct 7, 2026 7:42am UTC

Request Review

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (attributes) Add gen_ai memory conventions by ArthurKnaus in #653
  • (model) Add metric model by giortzisg in #649

Bug Fixes 🐛

  • (attributes) Remove any as valid attribute type by Lms24 in #677

Internal Changes 🔧

Deps

  • Bump sharp from 0.35.4 to 0.35.5 by dependabot in #683
  • Bump source-map-js from 1.2.1 to 1.2.2 by dependabot in #675
  • Bump smol-toml from 1.8.0 to 1.9.0 by dependabot in #674
  • Bump postcss-selector-parser from 7.1.4 to 7.1.6 by dependabot in #676

Other

  • (deps-dev) Bump oxfmt to 0.72.0 to pull in patched tinypool by Lms24 in #682
  • (docs) Add link preview meta tags by Lms24 in #667
  • (publish) Stop npm version from rewriting yarn.lock by Lms24 in #678
  • Deprecate mcp.tool.result.content_count by alexander-alderman-webb in #669

🤖 This preview updates automatically when you update the PR.

@linear-code

linear-code Bot commented Sep 28, 2026

Copy link
Copy Markdown

TET-3039

@ArthurKnaus
ArthurKnaus marked this pull request as ready for review September 28, 2026 08:27

@alexander-alderman-webb alexander-alderman-webb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 alexander-alderman-webb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for responding!
As always, wait a few days before merging to folks can have a look.

@ArthurKnaus
ArthurKnaus merged commit ef0e997 into main Oct 7, 2026
18 checks passed
@ArthurKnaus
ArthurKnaus deleted the feat/gen-ai-memory-conventions branch October 7, 2026 07:50
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

1 active deployment
Preview — 80c26d96 Deployed Oct 7, 2026 by vercel[bot]
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.

2 participants