Skip to content

Commit 40fa0c7

Browse files
mydeaclaude
andcommitted
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) <noreply@anthropic.com>
1 parent e408422 commit 40fa0c7

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

packages/nestjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"dependencies": {
4747
"@opentelemetry/api": "^1.9.1",
4848
"@opentelemetry/instrumentation": "^0.214.0",
49-
"@opentelemetry/semantic-conventions": "^1.40.0",
49+
"@sentry/conventions": "^0.11.0",
5050
"@sentry/core": "10.58.0",
5151
"@sentry/node": "10.58.0"
5252
},

packages/nestjs/src/integrations/vendored/instrumentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
InstrumentationNodeModuleFile,
2626
isWrapped,
2727
} from '@opentelemetry/instrumentation';
28-
import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';
28+
import { HTTP_ROUTE } from '@sentry/conventions/attributes';
2929
import type { SpanAttributes } from '@sentry/core';
3030
import { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';
3131
import { AttributeNames, NestType } from './enums';
@@ -170,7 +170,7 @@ function createWrapCreateHandler(moduleVersion: string | undefined) {
170170
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.nestjs',
171171
[AttributeNames.VERSION]: moduleVersion,
172172
[AttributeNames.TYPE]: NestType.REQUEST_CONTEXT,
173-
[ATTR_HTTP_ROUTE]: req.route?.path || req.routeOptions?.url || req.routerPath,
173+
[HTTP_ROUTE]: req.route?.path || req.routeOptions?.url || req.routerPath,
174174
[AttributeNames.CONTROLLER]: instanceName,
175175
[AttributeNames.CALLBACK]: callbackName,
176176
};

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7578,6 +7578,11 @@
75787578
"@sentry/cli-win32-i686" "2.58.6"
75797579
"@sentry/cli-win32-x64" "2.58.6"
75807580

7581+
"@sentry/conventions@^0.11.0":
7582+
version "0.11.0"
7583+
resolved "https://registry.yarnpkg.com/@sentry/conventions/-/conventions-0.11.0.tgz#5a324b8368dc5c141260bd8ccc684756ea3dd843"
7584+
integrity sha512-AQTAKeq9mDpOElDFSPymZTPZF/c50rk355mWTf5Y1ZxZJKKOBli5qTttskJyCxrE5ynNgN1KwcXoU5MRrMSRmQ==
7585+
75817586
"@sentry/node-cpu-profiler@^2.4.2":
75827587
version "2.4.2"
75837588
resolved "https://registry.yarnpkg.com/@sentry/node-cpu-profiler/-/node-cpu-profiler-2.4.2.tgz#d0ba01370545297d015df1497daf7f81e27f2ab5"

0 commit comments

Comments
 (0)