Skip to content

feat(attributes): Add legacy Vercel AI span attributes (deprecated) - #583

Merged
JPeer264 merged 1 commit into
jp/conv-amqp-redis-legacy-attrsfrom
jp/conv-vercel-ai-legacy-attrs
Aug 28, 2026
Merged

JPeer264 merged 1 commit into
jp/conv-amqp-redis-legacy-attrsfrom
jp/conv-vercel-ai-legacy-attrs

Conversation

@JPeer264

Copy link
Copy Markdown
Member

Adds the twelve ai.* and gen_ai.* attributes that the JavaScript SDK stopped emitting in v11, when the Vercel AI OpenTelemetry span processor was removed.

Six map onto a gen_ai.* replacement and join its alias group: ai.model.id, ai.prompt, ai.response.id, ai.response.model, ai.usage.tokens and ai.prompt.tools. The remaining six have no equivalent in the conventions and carry a reason only.

ai.prompt.tools gets a replacement but no alias here, so that the whole gen_ai.tool.definitions alias group can be completed in one place, in the last PR of this stack.

Deprecated by getsentry/sentry-javascript#23384

@github-actions

github-actions Bot commented Aug 27, 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 legacy Vercel AI span attributes (deprecated) by JPeer264 in #583
  • Add legacy AMQP and Redis span attributes (deprecated) by JPeer264 in #581
  • Add HTTP body size and status text attributes by msonnb in #574
  • Add graphql.processing.type by andreiborza in #572

Other

  • (span-names) Add url.domainrule for http.client spans by Lms24 in #575

Bug Fixes 🐛

Names

  • Add gen_ai.function_id and gen_ai.pipeline.name to agent span name templates by RulaKhaled in #593
  • Add missing gen_ai ops to span name rules by Lms24 in #579
  • Include tool name in gen_ai.execute_tool span names by Lms24 in #580
  • Correct graphql span name examples by andreiborza in #573

Internal Changes 🔧

  • (attributes) Add search alias for segment name by nsdeschenes in #577
  • (search-metadata) Add visibility field by nsdeschenes in #597

🤖 This preview updates automatically when you update the PR.

@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from af3a5bd to 6dc342f Compare August 27, 2026 07:59
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 6dc342f to 9236797 Compare August 27, 2026 08:11
@JPeer264
JPeer264 marked this pull request as ready for review August 27, 2026 08:16
@JPeer264
JPeer264 requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners August 27, 2026 08:16
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 9236797 to 47c9c4f Compare August 27, 2026 16:21
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 47c9c4f to 36638b7 Compare August 27, 2026 16:30
@JPeer264
JPeer264 changed the base branch from jp/conv-genai-cache-token-legacy to jp/conv-amqp-redis-legacy-attrs August 27, 2026 16:30
Comment thread python/src/sentry_conventions/attributes.py
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 36638b7 to 3292ff4 Compare August 27, 2026 16:49
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 3292ff4 to 5ad029a Compare August 28, 2026 11:49
Adds the twelve `ai.*` and `gen_ai.*` attributes that the JavaScript SDK
stopped emitting in v11 when the Vercel AI OTel span processor was removed.
Six map onto a `gen_ai.*` replacement and join its alias group; the rest
have no equivalent in the conventions and carry a reason only.

`ai.prompt.tools` gets a replacement but no alias, so that the whole
`gen_ai.tool.definitions` alias group can be completed in one place.

Deprecated by getsentry/sentry-javascript#23384

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/conv-vercel-ai-legacy-attrs branch from 5ad029a to d6de5de Compare August 28, 2026 12:12
Comment on lines +13 to +23
"reason": "This attribute is being deprecated in favor of gen_ai.tool.definitions."
},
"visibility": "public",
"changelog": [
{
"version": "next",
"prs": [583],
"description": "Added ai.prompt.tools attribute"
}
]
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The attribute ai.prompt.tools (a string[]) is configured to backfill to gen_ai.tool.definitions (a string), but their types are incompatible for a direct copy, which will cause ingestion failures.
Severity: HIGH

Suggested Fix

To resolve the type mismatch, either change _status from backfill to null and add a reason documenting the incompatibility, or change _status to transform and define a transformation to correctly convert the string[] value into a string.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: model/attributes/ai/ai__prompt__tools.json#L1-L23

Potential issue: The configuration for `ai.prompt.tools` specifies `_status: "backfill"`
to migrate its value to the replacement attribute `gen_ai.tool.definitions`. However,
the source attribute is a `string[]` (array of strings) while the destination is a
`string`. The backfill process performs a direct value copy, which will fail due to this
type mismatch. This will cause the ingestion pipeline to fail or lead to data corruption
when processing spans containing the `ai.prompt.tools` attribute. Existing patterns in
the codebase for such type mismatches use `_status: null` with a reason or `_status:
"transform"` to handle the conversion.

@JPeer264
JPeer264 merged commit 9336f94 into main Aug 28, 2026
24 of 25 checks passed
@JPeer264
JPeer264 deleted the jp/conv-vercel-ai-legacy-attrs branch August 28, 2026 12:26
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.

3 participants