From 40fa0c7f617d6acc8ca0cb05abde150bf8fb8ad1 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Fri, 12 Jun 2026 12:01:30 +0200 Subject: [PATCH] ref(nestjs): Use `@sentry/conventions` Source span/attribute keys from `@sentry/conventions` as a regular dependency (externalized at build time, resolved at runtime). No functional change. Maps the `@sentry/conventions/attributes` subpath in the shared TS config for the repo's `node` moduleResolution type builds. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/nestjs/package.json | 2 +- packages/nestjs/src/integrations/vendored/instrumentation.ts | 4 ++-- yarn.lock | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/nestjs/package.json b/packages/nestjs/package.json index 9997e56f891d..be81d1b2c2c5 100644 --- a/packages/nestjs/package.json +++ b/packages/nestjs/package.json @@ -46,7 +46,7 @@ "dependencies": { "@opentelemetry/api": "^1.9.1", "@opentelemetry/instrumentation": "^0.214.0", - "@opentelemetry/semantic-conventions": "^1.40.0", + "@sentry/conventions": "^0.11.0", "@sentry/core": "10.58.0", "@sentry/node": "10.58.0" }, diff --git a/packages/nestjs/src/integrations/vendored/instrumentation.ts b/packages/nestjs/src/integrations/vendored/instrumentation.ts index 8dc48e361a6a..a6d15c7dcd8f 100644 --- a/packages/nestjs/src/integrations/vendored/instrumentation.ts +++ b/packages/nestjs/src/integrations/vendored/instrumentation.ts @@ -25,7 +25,7 @@ import { InstrumentationNodeModuleFile, isWrapped, } from '@opentelemetry/instrumentation'; -import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions'; +import { HTTP_ROUTE } from '@sentry/conventions/attributes'; import type { SpanAttributes } from '@sentry/core'; import { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core'; import { AttributeNames, NestType } from './enums'; @@ -170,7 +170,7 @@ function createWrapCreateHandler(moduleVersion: string | undefined) { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.nestjs', [AttributeNames.VERSION]: moduleVersion, [AttributeNames.TYPE]: NestType.REQUEST_CONTEXT, - [ATTR_HTTP_ROUTE]: req.route?.path || req.routeOptions?.url || req.routerPath, + [HTTP_ROUTE]: req.route?.path || req.routeOptions?.url || req.routerPath, [AttributeNames.CONTROLLER]: instanceName, [AttributeNames.CALLBACK]: callbackName, }; diff --git a/yarn.lock b/yarn.lock index 61fbf639cfc9..72f2a5e06140 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7578,6 +7578,11 @@ "@sentry/cli-win32-i686" "2.58.6" "@sentry/cli-win32-x64" "2.58.6" +"@sentry/conventions@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@sentry/conventions/-/conventions-0.11.0.tgz#5a324b8368dc5c141260bd8ccc684756ea3dd843" + integrity sha512-AQTAKeq9mDpOElDFSPymZTPZF/c50rk355mWTf5Y1ZxZJKKOBli5qTttskJyCxrE5ynNgN1KwcXoU5MRrMSRmQ== + "@sentry/node-cpu-profiler@^2.4.2": version "2.4.2" resolved "https://registry.yarnpkg.com/@sentry/node-cpu-profiler/-/node-cpu-profiler-2.4.2.tgz#d0ba01370545297d015df1497daf7f81e27f2ab5"