Title: Update span attributes to use `@sentry/conventions` · Issue #18895 · getsentry/sentry-javascript · GitHub
Open Graph Title: Update span attributes to use `@sentry/conventions` · Issue #18895 · getsentry/sentry-javascript
X Title: Update span attributes to use `@sentry/conventions` · Issue #18895 · getsentry/sentry-javascript
Description: Description For the next Major SDK version, we should stop sending attributes we deprecated in our conventions and (if not done already) replace them with their stable replacements. Overall, we should likely move to our @sentry/conventio...
Open Graph Description: Description For the next Major SDK version, we should stop sending attributes we deprecated in our conventions and (if not done already) replace them with their stable replacements. Overall, we sho...
X Description: Description For the next Major SDK version, we should stop sending attributes we deprecated in our conventions and (if not done already) replace them with their stable replacements. Overall, we sho...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/18895
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update span attributes to use `@sentry/conventions`","articleBody":"### Description\n\nFor the next Major SDK version, we should stop sending attributes we deprecated in [our conventions](\u003chttps://getsentry.github.io/sentry-conventions/attributes/>) and (if not done already) replace them with their stable replacements.\n\nOverall, we should likely move to our `@sentry/conventions` package generally and unify usage there. We need to make sure that we do not remove anything users may heavily rely on (or that this is backfilled or similar, …)\n\nLocations marked *(reads)* only consume the deprecated attribute for back-compat and can likely stay (or be dropped last); everything else actively **sets** it.\n\n---\n\n## AI Attributes (`ai.*`)\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `ai.pipeline.name` | `gen_ai.pipeline.name` | server-utils/src/ai/vercel-ai/index.ts (L424, raw string) |\n| `ai.streaming` | `gen_ai.response.streaming` | server-utils/src/ai/vercel-ai/index.ts (L437, raw string) |\n\n`packages/server-utils/src/ai/langgraph/index.ts` already uses `GEN_AI_PIPELINE_NAME` — Vercel AI is the only holdout.\n\n---\n\n## Code Attributes (`code.*`)\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `code.filepath` | `code.file.path` | browser-utils/src/performance/entries.ts (L143, raw string) |\n| `code.function` | `code.function.name` | browser-utils/src/performance/entries.ts (L146, raw string) |\n\nNote: as of `@sentry/conventions@0.19.0`, `code.function` is not yet flagged `@deprecated` (it and `code.function.name` are listed as aliases), but it will be deprecated in favor of `code.function.name` — so migrate it along with `code.filepath`. The `packages/remix/src/server/integrations/opentelemetry.ts` occurrence from the original audit is gone with the file.\n\n---\n\n## Database Attributes (`db.*`)\n\nAlmost all of these moved into `packages/server-utils/src/` when the OTel DB instrumentations were vendored. They are set via the deprecated `@sentry/conventions` constants (`DB_SYSTEM`, `DB_STATEMENT`, …) or via local `ATTR_DB_*` string constants.\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `db.name` | `db.namespace` | `server-utils/src/integrations/aws-sdk/services/dynamodb.ts`, `server-utils/src/integrations/knex.ts`, `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/integrations/mysql.ts`, `server-utils/src/integrations/mysql2.ts`, `server-utils/src/integrations/postgres.ts`, `server-utils/src/integrations/tedious.ts`, `server-utils/src/mongoose/mongoose-legacy-span.ts` |\n| `db.operation` | `db.operation.name` | `core/src/integrations/supabase.ts` (L280, L440, raw strings), `server-utils/src/integrations/aws-sdk/services/dynamodb.ts`, `server-utils/src/integrations/knex.ts`, `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/mongoose/mongoose-legacy-span.ts` |\n| `db.statement` | `db.query.text` | `server-utils/src/integrations/ioredis.ts`, `server-utils/src/integrations/knex.ts`, `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/integrations/mysql.ts`, `server-utils/src/integrations/mysql2.ts`, `server-utils/src/integrations/postgres.ts`, `server-utils/src/integrations/redis.ts`, `server-utils/src/integrations/tedious.ts`, `server-utils/src/prisma/tracing-helper.ts` *(reads)* |\n| `db.system` | `db.system.name` | `core/src/integrations/supabase.ts` (L279, L439, raw strings), `server-utils/src/integrations/aws-sdk/services/dynamodb.ts`, `server-utils/src/integrations/ioredis.ts`, `server-utils/src/integrations/knex.ts`, `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/integrations/mysql.ts`, `server-utils/src/integrations/mysql2.ts`, `server-utils/src/integrations/postgres.ts`, `server-utils/src/integrations/redis.ts`, `server-utils/src/integrations/tedious.ts`, `server-utils/src/mongoose/mongoose-legacy-span.ts`, `server-utils/src/prisma/tracing-helper.ts` (backfill) |\n| `db.mongodb.collection` (newly deprecated) | `db.collection.name` | `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/mongoose/mongoose-legacy-span.ts` |\n\n`packages/server-utils/src/integrations/ioredis.ts` and `redis.ts` already carry `TODO(v11)` comments for exactly this migration.\n\nNote: `db.user`, `db.connection_string` and `db.sql.table` are **not** deprecated in `@sentry/conventions@0.19.0` — no action needed there.\n\n---\n\n## HTTP Attributes (`http.*`)\n\nThe old `node-core` HTTP integration is gone. Server-side HTTP attributes now live in `packages/core/src/integrations/http/` and `packages/node/src/integrations/http/httpServerSpansIntegration.ts` (the latter sets them deliberately, guarded by `eslint-disable typescript/no-deprecated`, for compatibility with what `@opentelemetry/instrumentation-http` used to emit).\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `http.client_ip` | `client.address` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `http.flavor` | `network.protocol.version` | `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `http.host` | `server.address` | `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `http.method` | `http.request.method` | **Sets:** `browser/src/tracing/request.ts`, `browser/src/integrations/fetchStreamPerformance.ts`, `core/src/fetch.ts`, `core/src/integrations/http/add-outgoing-request-breadcrumb.ts`, `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `core/src/types/request.ts` (type), `nestjs/src/integrations/wrap-route.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts`, `node/src/utils/outgoingFetchRequest.ts`, `react-router/src/server/createServerInstrumentation.ts`, `remix/src/server/integrations/tracing-channel.ts`, `server-utils/src/integrations/hapi-utils.ts`, `sveltekit/src/server-common/handle.ts`, `sveltekit/src/server-common/load.ts`. **Reads:** `browser/src/integrations/graphqlClient.ts`, `nextjs/src/common/utils/getNormalizedRequestFromAttributes.ts`, `nextjs/src/edge/enhanceRunHandlerRootSpan.ts`, `nextjs/src/server/enhanceHandleRequestRootSpan.ts`, `nextjs/src/server/handleOnSpanStart.ts`, `server-utils/src/utils/setHttpServerSpanRouteAttribute.ts` |\n| `http.response_content_length` | `http.response.body.size` | `browser-utils/src/performance/entries.ts`, `core/src/fetch.ts`, `core/src/integrations/http/get-outgoing-span-data.ts` |\n| `http.response_transfer_size` | `http.response.size` | `browser-utils/src/performance/entries.ts` |\n| `http.scheme` | `url.scheme` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `http.status_code` | `http.response.status_code` | **Sets:** `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts`, `remix/src/server/integrations/tracing-channel.ts`, `server-utils/src/integrations/aws-sdk/index.ts`. **Reads:** `nextjs/src/common/utils/backfillHttpResponseStatusCode.ts`, `nextjs/src/common/utils/backfillHttpServerStatus.ts` |\n| `http.target` | `url.path` | **Sets:** `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts`. **Reads / filters:** `nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts`, `nextjs/src/common/utils/getNormalizedRequestFromAttributes.ts`, `nextjs/src/common/utils/setUrlProcessingMetadata.ts`, `nextjs/src/server/enhanceHandleRequestRootSpan.ts`, `nextjs/src/server/index.ts`, `react-router/src/server/integration/lowQualityTransactionsFilterIntegration.ts`, `solidstart/src/server/withServerActionInstrumentation.ts`, `tanstackstart-react/src/server/tunnelRoute.ts` |\n| `http.user_agent` | `user_agent.original` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n\n---\n\n## Network Attributes (`net.*`)\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `net.host.ip` | `network.local.address` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `net.host.name` | `server.address` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `net.host.port` | `server.port` | `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `net.peer.ip` | `network.peer.address` | `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `net.peer.name` | `server.address` | `core/src/integrations/http/get-outgoing-span-data.ts`, `node/src/integrations/tracing/redis/cache.ts` *(reads)*, `server-utils/src/integrations/amqplib.ts`, `server-utils/src/integrations/ioredis.ts`, `server-utils/src/integrations/knex.ts`, `server-utils/src/integrations/mongodb/mongodb-span.ts`, `server-utils/src/integrations/mysql.ts`, `server-utils/src/integrations/mysql2.ts`, `server-utils/src/integrations/postgres.ts`, `server-utils/src/integrations/redis.ts`, `server-utils/src/integrations/tedious.ts`, `server-utils/src/mongoose/mongoose-legacy-span.ts` |\n| `net.peer.port` | `server.port` | same set as `net.peer.name`, plus `core/src/integrations/http/server-subscription.ts` and `node/src/integrations/http/httpServerSpansIntegration.ts` |\n| `net.transport` | `network.transport` | `core/src/integrations/http/get-outgoing-span-data.ts`, `core/src/integrations/http/server-subscription.ts`, `node/src/integrations/http/httpServerSpansIntegration.ts`, `server-utils/src/integrations/knex.ts` |\n\n---\n\n## GenAI Attributes (`gen_ai.*`)\n\nAll AI instrumentation moved to `packages/server-utils/src/ai/` and grew from 2 providers to 7+. These are set via the deprecated constants from `@sentry/conventions/attributes`.\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `gen_ai.prompt` | `gen_ai.input.messages` | `server-utils/src/ai/anthropic-ai/index.ts` |\n| `gen_ai.response.text` | `gen_ai.output.messages` | `server-utils/src/ai/anthropic-ai/index.ts`, `server-utils/src/ai/core/utils.ts`, `server-utils/src/ai/google-genai/index.ts`, `server-utils/src/ai/langchain/utils.ts`, `server-utils/src/ai/langgraph/utils.ts`, `server-utils/src/ai/openai/utils.ts`, `server-utils/src/ai/workers-ai/utils.ts` |\n| `gen_ai.response.tool_calls` | `gen_ai.output.messages` | same set as `gen_ai.response.text` |\n\nCaveat documented in `server-utils/src/ai/workers-ai/utils.ts`: Relay migrates `gen_ai.response.text` into `gen_ai.output.messages`, but **not** the tool-calls half — so dropping `gen_ai.response.tool_calls` needs product-side coordination before it can be removed.\n\n---\n\n## Other Deprecated Attributes\n\n\u003c!-- linear:table-colwidths:200,200,200 -->\n| Deprecated Attribute | Replacement | Files (Source Code) |\n| -- | -- | -- |\n| `fs_error` | `error.type` | node/src/integrations/fs/vendored/instrumentation.ts (L313) |\n\n---\n\n## Already resolved since the original audit\n\nThese rows from the original audit no longer apply and were removed:\n\n* `ai.model.provider` — no longer emitted; Vercel AI now sets `gen_ai.provider.name` plus the non-deprecated `vercel.ai.model.provider`. `server-utils/src/ai/vercel-ai/index.ts` even renames incoming `gen_ai.system` → `gen_ai.provider.name`.\n* `http.url` — zero occurrences left in `packages/*/src`; fully migrated to `url.full`.\n* `gen_ai.request.messages` **/** `gen_ai.request.available_tools` — zero occurrences left; migrated to `gen_ai.input.messages` / `gen_ai.tool.definitions`.\n* `profile_id` — migrated to `sentry.profile_id` (`core/src/semanticAttributes.ts`, `core/src/tracing/spans/scopeContextAttributes.ts`). Remaining `profile_id` hits are event/context payload fields, not span attributes.\n* `replay_id` — the span-attribute case is `sentry.replay_id` (`replay-internal/src/integration.ts`, `browser-utils/src/web-vitals/spans.ts`, `core/src/logs/internal.ts`, `core/src/metrics/internal.ts`). Remaining `replay_id` hits are DSC / feedback-context fields and doc comments, not span attributes.\n* **The entire \"OpenTelemetry Semantic Convention Constants Used (Deprecated)\" section** — `@opentelemetry/semantic-conventions` and all `SEMATTRS_*` constants have been removed from the repo (zero hits in `packages/` and `dev-packages/`). Everything now goes through `@sentry/conventions/attributes`.\n\n---\n\n## Test fixtures\n\nBeyond source, deprecated attributes are asserted on in integration test fixtures across `dev-packages/node-integration-tests/suites/{tracing,express,aws-serverless}`, `dev-packages/deno-integration-tests/suites/orchestrion-*` (mongo, mongoose, mysql, mysql2, postgres, tedious), `dev-packages/browser-integration-tests/suites/{tracing,integrations}`, `dev-packages/bun-integration-tests/suites/fetch` and `dev-packages/cloudflare-integration-tests/suites/vite-autoinstrument`. These will need updating alongside each source change.","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2026-01-20T10:25:35Z","url":"https://github.com/getsentry/sentry-javascript/issues/18895"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54989395-93d7-f5c3-793f-7c1dc43b454c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C47A:3714B8:94F2DB:CCE696:6B04502D |
| html-safe-nonce | 6a0023eb8bbcb91167f7533c0a02cafe0c2037ed5ff7faed17ca4445cb73ed72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDdBOjM3MTRCODo5NEYyREI6Q0NFNjk2OjZCMDQ1MDJEIiwidmlzaXRvcl9pZCI6IjkxNzgzOTk2MjUwNzIzNjU2MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 929bb22f6b0c28763a8b1f3708b1ab388fc02e2cf31e2b2fd088a87c0dce5093 |
| hovercard-subject-tag | issue:3833068071 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/18895/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1cf1d351de0785bf7f75dbcc6c6cbf408df917f36740645ac8275d79005c6dc5/getsentry/sentry-javascript/issues/18895 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1cf1d351de0785bf7f75dbcc6c6cbf408df917f36740645ac8275d79005c6dc5/getsentry/sentry-javascript/issues/18895 |
| og:image:alt | Description For the next Major SDK version, we should stop sending attributes we deprecated in our conventions and (if not done already) replace them with their stable replacements. Overall, we sho... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width