Skip to content

ref(node): Use @sentry/conventions and vendor remaining semantic conventions#21635

Draft
mydea wants to merge 2 commits into
developfrom
fn/node-semantic-conventions
Draft

ref(node): Use @sentry/conventions and vendor remaining semantic conventions#21635
mydea wants to merge 2 commits into
developfrom
fn/node-semantic-conventions

Conversation

@mydea

@mydea mydea commented Jun 18, 2026

Copy link
Copy Markdown
Member

Source span attribute keys in @sentry/node from @sentry/conventions/attributes instead of the locally vendored ./semconv constants and @opentelemetry/semantic-conventions, for the attributes that have a @sentry/conventions equivalent. This mirrors the previous ref(aws-serverless): Use @sentry/conventions change (#21597).

In a second step, the symbols that have no @sentry/conventions equivalent and were still imported from @opentelemetry/semantic-conventions are now vendored locally as well, so @sentry/node's source no longer imports from that package at all.

No functional change — string values are identical throughout.

Details

  • Migrated to @sentry/conventions/attributes across the redis/ioredis, mongo, mongoose, mysql, mysql2, postgres, postgresjs, tedious, knex, kafka, amqplib, hapi, koa, connect, fastify, hono, firebase and undici integrations: the db.*, http.*, url.*, server.*, network.peer.*, messaging.*, error.type and user_agent.original keys that exist in conventions. Now-unused ATTR_* exports were pruned from the vendored semconv.ts files (hapi/vendored/semconv.ts became empty and was deleted).
  • Kept vendored locally (no conventions equivalent): net.peer.*, db.connection_string, db.mongodb.collection, db.sql.table, db.client.connection.*, db.response.status_code, kafka-specific keys, the amqplib semconv-obsolete.ts set, and all *_VALUE_* / METRIC_* constants.
  • Vendored in the remaining @opentelemetry/semantic-conventions imports so the package no longer depends on it at runtime: value/metric constants (DB_SYSTEM_NAME_VALUE_POSTGRESQL, DB_SYSTEM_NAME_VALUE_MYSQL, ERROR_TYPE_VALUE_OTHER, METRIC_DB_CLIENT_OPERATION_DURATION) moved into the relevant semconv.ts; a new node-fetch/vendored/semconv.ts holds ATTR_HTTP_REQUEST_METHOD_ORIGINAL and METRIC_HTTP_CLIENT_REQUEST_DURATION for the vendored undici instrumentation; and db.response.status_code was inlined into the first-party postgresjs.ts.
  • The legacy db.system/db.statement/db.name/http.method keys are deprecated in @sentry/conventions, so the few intentional emissions in vendored files that lack a whole-file lint disable carry a targeted typescript/no-deprecated disable.

@opentelemetry/semantic-conventions is still listed in package.json (it is no longer imported by source, but removing the dependency is intentionally left out of this refactor).

@mydea mydea force-pushed the fn/node-semantic-conventions branch from 06214fd to 8ed390c Compare June 18, 2026 14:22
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.45 kB - -
@sentry/browser - with treeshaking flags 25.88 kB - -
@sentry/browser (incl. Tracing) 45.88 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.11 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.65 kB - -
@sentry/browser (incl. Tracing, Replay) 85.08 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.68 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.78 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.44 kB - -
@sentry/browser (incl. Feedback) 44.62 kB - -
@sentry/browser (incl. sendFeedback) 32.25 kB - -
@sentry/browser (incl. FeedbackAsync) 37.38 kB - -
@sentry/browser (incl. Metrics) 28.52 kB - -
@sentry/browser (incl. Logs) 28.76 kB - -
@sentry/browser (incl. Metrics & Logs) 29.45 kB - -
@sentry/react 29.25 kB - -
@sentry/react (incl. Tracing) 48.17 kB - -
@sentry/vue 32.56 kB - -
@sentry/vue (incl. Tracing) 47.74 kB - -
@sentry/svelte 27.48 kB - -
CDN Bundle 29.86 kB - -
CDN Bundle (incl. Tracing) 48.28 kB - -
CDN Bundle (incl. Logs, Metrics) 31.4 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.58 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.71 kB - -
CDN Bundle (incl. Tracing, Replay) 85.61 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.71 kB - -
CDN Bundle - uncompressed 88.8 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.04 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.5 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.02 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.33 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.91 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.56 kB - -
@sentry/nextjs (client) 50.58 kB - -
@sentry/sveltekit (client) 46.27 kB - -
@sentry/core/server 76.16 kB - -
@sentry/core/browser 63.31 kB - -
@sentry/node-core 61.87 kB -0.01% -1 B 🔽
@sentry/node 127.51 kB -0.14% -171 B 🔽
@sentry/node - without tracing 74.26 kB -0.01% -3 B 🔽
@sentry/aws-serverless 85.32 kB -0.03% -24 B 🔽
@sentry/cloudflare (withSentry) - minified 174.48 kB - -
@sentry/cloudflare (withSentry) 436.52 kB - -

View base workflow run

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.

1 participant