Skip to content

ref: Make span origins spec compliant - #25602

Open
mydea wants to merge 1 commit into
developfrom
ref/span-origin-spec-violations
Open

mydea wants to merge 1 commit into
developfrom
ref/span-origin-spec-violations

Conversation

@mydea

@mydea mydea commented Oct 21, 2026

Copy link
Copy Markdown
Member

Several span origins didn't follow the trace origin spec (<type>.<category>.<integration_name>.<integration_part>, where category is a span op category). Most put the library in the category slot, which makes it impossible to group origins by category the way ops are grouped. v11 is already renaming origins (#22722, #23627), so this is the window to fix them.

Before After
auto.amqplib.{publisher,consumer} auto.queue.amqplib.{publisher,consumer}
auto.kafkajs.{producer,consumer} auto.queue.kafkajs.{producer,consumer}
auto.vercelai.channel auto.ai.vercelai (matches the other auto.ai.<provider> origins)
auto.firebase.firestore auto.db.firebase.firestore
auto.firebase.functions auto.function.firebase
auto.aws.aws_sdk auto.rpc.aws_sdk
auto.aws_lambda auto.function.aws_lambda
auto.mcp.notification auto.function.mcp_server.notification (sits next to auto.function.mcp_server)
auto.db.cloudflare.durable_object.sql auto.db.cloudflare.durable_object_sql (was five parts)
auto.http.browser.{lcp,cls,inp} auto.ui.browser.{lcp,cls,inp} (web vital spans, op ui.webvital.*)

The Vercel AI exception mechanism type moves along with its origin. AGENTS.md and BUGBOT.md now spell out the category and four-part rules so new origins are checked against them.

🤖 Generated with Claude Code

@mydea mydea changed the title ref!: Make span origins spec compliant ref: Make span origins spec compliant Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: b30e8d6 (PR test merge using develop at 24186f0)

Against: 24186f0 (develop) · base run #63081

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.91 kB - -
@sentry/browser - with treeshaking flags 28.05 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.95 kB - -
@sentry/browser (incl. Tracing) 52.1 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.1 kB -0.01% -1 B 🔽
@sentry/browser (incl. Tracing, Profiling) 55.04 kB -0.01% -3 B 🔽
@sentry/browser (incl. Tracing, Replay) 91.85 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.72 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.52 kB - -
@sentry/browser (incl. Feedback) 47.42 kB - -
@sentry/browser (incl. sendFeedback) 34.97 kB - -
@sentry/browser (incl. FeedbackAsync) 40.07 kB - -
@sentry/browser (incl. Metrics) 30.93 kB - -
@sentry/browser (incl. Logs) 31.21 kB - -
@sentry/browser (incl. Metrics & Logs) 31.84 kB - -
@sentry/react 31.74 kB - -
@sentry/react (incl. Tracing) 54.42 kB -0.01% -1 B 🔽
@sentry/vue 38.07 kB - -
@sentry/vue (incl. Tracing) 55.03 kB - -
@sentry/svelte 29.93 kB - -
@sentry/remix (Remix 3 client bundle) 57.11 kB -0.01% -1 B 🔽
CDN Bundle 31.67 kB - -
CDN Bundle (incl. Tracing) 52.61 kB -0.01% -3 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.87 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.55 kB -0.01% -3 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 74.79 kB - -
CDN Bundle (incl. Tracing, Replay) 90.28 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 92.2 kB -0.01% -3 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 96.42 kB -0.01% -4 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.37 kB -0.01% -3 B 🔽
CDN Bundle - uncompressed 93.29 kB - -
CDN Bundle (incl. Tracing) - uncompressed 156.13 kB -0.01% -6 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.84 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.1 kB -0.01% -6 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.88 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 276.3 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.26 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 290 kB -0.01% -6 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.95 kB -0.01% -6 B 🔽
@sentry/nextjs (client) 57.3 kB -0.01% -1 B 🔽
@sentry/sveltekit (client) 52.47 kB -0.01% -2 B 🔽
@sentry/core/server 41.85 kB +0.01% +1 B 🔺
@sentry/core/browser 13.81 kB - -
@sentry/node 152.86 kB +0.01% +3 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 94.45 kB +0.01% +1 B 🔺
@sentry/node - without channel injection 133.52 kB +0.01% +3 B 🔺
@sentry/aws-serverless 102.62 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 191.69 kB - -
@sentry/cloudflare (withSentry) 476.34 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 212.65 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review October 21, 2026 11:35
@mydea
mydea requested review from a team as code owners October 21, 2026 11:35
@mydea
mydea requested review from Lms24, andreiborza, isaacs and logaretm and removed request for a team October 21, 2026 11:35
mydea added a commit that referenced this pull request Oct 22, 2026
The `.diagnostic_channel` suffix on span origins was left over from v10,
where it distinguished these spans from the OTel-based ones. The rest of
the v11 origins already dropped mechanism parts like `.otel` and
`.orchestrion`.

- `auto.graphql.diagnostic_channel` → `auto.graphql.graphql`: graphql
has a single instrumentation path, so the suffix carried no information.
The integration name stays, as in every other
`auto.<category>.<integration>` origin.
- `auto.db.{redis,mysql2,mongoose}.diagnostic_channel` →
`auto.db.{redis,mysql2,mongoose}.native_channel`: these integrations
still have two paths, the library's own tracing channels (newer
versions) and orchestrion-injected channels (older versions, plain
`auto.db.<lib>`). `native_channel` says what the distinction actually
is.

While at it, two origins that were inconsistent with their siblings:

- `auto.http.wintercg_fetch` → `auto.http.fetch`: Bun, Deno and
Cloudflare already use `auto.http.fetch` for the same instrumentation.
- `auto.grpc.serverless` → `auto.grpc.google_cloud`: `serverless` didn't
name the integration.

Spec violations (category, part count) are handled separately in #25602.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Use a span op category as the second origin part, keep origins at most
four parts, and stop encoding the instrumentation mechanism:

- auto.amqplib.* -> auto.queue.amqplib.*
- auto.kafkajs.* -> auto.queue.kafkajs.*
- auto.vercelai.channel -> auto.ai.vercelai
- auto.firebase.firestore -> auto.db.firebase.firestore
- auto.firebase.functions -> auto.function.firebase
- auto.aws.aws_sdk -> auto.rpc.aws_sdk
- auto.aws_lambda -> auto.function.aws_lambda
- auto.mcp.notification -> auto.function.mcp_server.notification
- auto.db.cloudflare.durable_object.sql -> auto.db.cloudflare.durable_object_sql
- auto.http.browser.{lcp,cls,inp} -> auto.ui.browser.{lcp,cls,inp}

Also spell out the origin rules in AGENTS.md and BUGBOT.md so new
origins follow them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mydea
mydea force-pushed the ref/span-origin-spec-violations branch from 79f052c to 6945fb7 Compare October 22, 2026 07:11
@github-actions

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 3 failing, 61 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry (latest) Test (optional) Failing after 18s Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry (latest) Test (optional) Failing after 4m Details
❌ CI: Optional E2E Tests / E2E node-openai-decisions-send-to-sentry Test (optional) Failing after 9m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, webpack) Test (optional) Successful in 6m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (canary) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 26s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 5m Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E node-anthropic-send-to-sentry Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E nuxt-4-static (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 53s Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 7m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 12m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4 (canary) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 48s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (canary, turbopack) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-3 (canary) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E node-openai-send-to-sentry (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E angular (canary) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 6m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-standalone (canary, turbopack) Test (optional) Successful in 31s Details
✅ CI: Optional E2E Tests / E2E vue-3 (canary) Test (optional) Successful in 56s Details

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup, thanks! One open question regarding ai vs. gen_ai but otherwise LGTM!

Comment thread .cursor/BUGBOT.md
- `SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN` (`'sentry.origin'`) with a proper span origin
- a proper origin must only contain [a-z], [A-Z], [0-9], `_` and `.` characters.
- a proper origin has at most four parts, `<type>.<category>.<integration_name>.<integration_part>`, and must not skip a part. `type` is `auto` or `manual`.
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).
- `category` must be a span op category (e.g. `http`, `db`, `queue`, `function`, `gen_ai`, `ui`, `rpc`), matching the span's op. Flag origins that put a library or vendor in the category slot (e.g. `auto.kafkajs.producer` instead of `auto.queue.kafkajs.producer`).

attributes: expect.objectContaining({
'sentry.op': { type: 'string', value: 'gen_ai.invoke_agent' },
'sentry.origin': { type: 'string', value: 'auto.vercelai.channel' },
'sentry.origin': { type: 'string', value: 'auto.ai.vercelai' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l/m: if we want to double down on the "the second part must be a span op category", this should be

Suggested change
'sentry.origin': { type: 'string', value: 'auto.ai.vercelai' },
'sentry.origin': { type: 'string', value: 'auto.gen_ai.vercelai' },

logaretm
logaretm previously approved these changes Oct 22, 2026
@logaretm
logaretm self-requested a review October 22, 2026 18:01

@logaretm logaretm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got a couple of things here


/** The span origin every aws-sdk channel span carries. */
export const AWS_SDK_ORIGIN = 'auto.aws.aws_sdk';
export const AWS_SDK_ORIGIN = 'auto.rpc.aws_sdk';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A DynamoDB span gets op db but origin auto.rpc.aws_sdk. If the origin category should match the op, that span should be auto.db.aws_sdk, SQS/SNS auto.queue.aws_sdk, and Bedrock auto.ai.aws_sdk.

attributes: {
[SENTRY_OP]: FUNCTION_AWS,
[SENTRY_ORIGIN]: 'auto.aws_lambda',
[SENTRY_ORIGIN]: 'auto.function.aws_lambda',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be auto.function.aws_serverless? The errors from this same handler already use aws_serverless as the name.

@logaretm
logaretm dismissed their stale review October 22, 2026 18:12

too premature

This branch has not been deployed

No deployments
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