@sentry/node 8.21.0 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/cjs/index.js +2 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/anr/index.js +1 -1
  4. package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  5. package/build/cjs/integrations/tracing/index.js +1 -1
  6. package/build/cjs/integrations/tracing/index.js.map +1 -1
  7. package/build/cjs/integrations/tracing/nest/helpers.js +39 -0
  8. package/build/cjs/integrations/tracing/nest/helpers.js.map +1 -0
  9. package/build/cjs/integrations/tracing/nest/nest.js +123 -0
  10. package/build/cjs/integrations/tracing/nest/nest.js.map +1 -0
  11. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js +178 -0
  12. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js.map +1 -0
  13. package/build/esm/index.js +2 -2
  14. package/build/esm/integrations/anr/index.js +1 -1
  15. package/build/esm/integrations/anr/worker-script.js +2 -2
  16. package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  17. package/build/esm/integrations/local-variables/worker-script.js +1 -1
  18. package/build/esm/integrations/tracing/index.js +1 -1
  19. package/build/esm/integrations/tracing/index.js.map +1 -1
  20. package/build/esm/integrations/tracing/nest/helpers.js +36 -0
  21. package/build/esm/integrations/tracing/nest/helpers.js.map +1 -0
  22. package/build/esm/integrations/tracing/nest/nest.js +116 -0
  23. package/build/esm/integrations/tracing/nest/nest.js.map +1 -0
  24. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js +176 -0
  25. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js.map +1 -0
  26. package/build/types/index.d.ts +2 -2
  27. package/build/types/index.d.ts.map +1 -1
  28. package/build/types/integrations/tracing/nest/helpers.d.ts +19 -0
  29. package/build/types/integrations/tracing/nest/helpers.d.ts.map +1 -0
  30. package/build/types/integrations/tracing/nest/nest.d.ts +15 -0
  31. package/build/types/integrations/tracing/nest/nest.d.ts.map +1 -0
  32. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +29 -0
  33. package/build/types/integrations/tracing/nest/sentry-nest-instrumentation.d.ts.map +1 -0
  34. package/build/types/integrations/tracing/nest/types.d.ts +50 -0
  35. package/build/types/integrations/tracing/nest/types.d.ts.map +1 -0
  36. package/build/types-ts3.8/index.d.ts +2 -2
  37. package/build/types-ts3.8/integrations/tracing/nest/helpers.d.ts +19 -0
  38. package/build/types-ts3.8/integrations/tracing/nest/nest.d.ts +15 -0
  39. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-instrumentation.d.ts +29 -0
  40. package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +50 -0
  41. package/package.json +5 -5
  42. package/build/cjs/integrations/tracing/nest.js +0 -253
  43. package/build/cjs/integrations/tracing/nest.js.map +0 -1
  44. package/build/esm/integrations/tracing/nest.js +0 -244
  45. package/build/esm/integrations/tracing/nest.js.map +0 -1
  46. package/build/types/integrations/tracing/nest.d.ts +0 -82
  47. package/build/types/integrations/tracing/nest.d.ts.map +0 -1
  48. package/build/types-ts3.8/integrations/tracing/nest.d.ts +0 -82
@@ -0,0 +1,176 @@
1
+ import { isWrapped } from '@opentelemetry/core';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition, InstrumentationNodeModuleFile } from '@opentelemetry/instrumentation';
3
+ import { getActiveSpan, startSpanManual, withActiveSpan, startSpan } from '@sentry/core';
4
+ import { SDK_VERSION } from '@sentry/utils';
5
+ import { isPatched, getMiddlewareSpanOptions } from './helpers.js';
6
+
7
+ const supportedVersions = ['>=8.0.0 <11'];
8
+
9
+ /**
10
+ * Custom instrumentation for nestjs.
11
+ *
12
+ * This hooks into the @Injectable decorator, which is applied on class middleware, interceptors and guards.
13
+ */
14
+ class SentryNestInstrumentation extends InstrumentationBase {
15
+ static __initStatic() {this.COMPONENT = '@nestjs/common';}
16
+ static __initStatic2() {this.COMMON_ATTRIBUTES = {
17
+ component: SentryNestInstrumentation.COMPONENT,
18
+ };}
19
+
20
+ constructor(config = {}) {
21
+ super('sentry-nestjs', SDK_VERSION, config);
22
+ }
23
+
24
+ /**
25
+ * Initializes the instrumentation by defining the modules to be patched.
26
+ */
27
+ init() {
28
+ const moduleDef = new InstrumentationNodeModuleDefinition(SentryNestInstrumentation.COMPONENT, supportedVersions);
29
+
30
+ moduleDef.files.push(this._getInjectableFileInstrumentation(supportedVersions));
31
+ return moduleDef;
32
+ }
33
+
34
+ /**
35
+ * Wraps the @Injectable decorator.
36
+ */
37
+ _getInjectableFileInstrumentation(versions) {
38
+ return new InstrumentationNodeModuleFile(
39
+ '@nestjs/common/decorators/core/injectable.decorator.js',
40
+ versions,
41
+ (moduleExports) => {
42
+ if (isWrapped(moduleExports.Injectable)) {
43
+ this._unwrap(moduleExports, 'Injectable');
44
+ }
45
+ this._wrap(moduleExports, 'Injectable', this._createWrapInjectable());
46
+ return moduleExports;
47
+ },
48
+ (moduleExports) => {
49
+ this._unwrap(moduleExports, 'Injectable');
50
+ },
51
+ );
52
+ }
53
+
54
+ /**
55
+ * Creates a wrapper function for the @Injectable decorator.
56
+ *
57
+ * Wraps the use method to instrument nest class middleware.
58
+ */
59
+ _createWrapInjectable() {
60
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
+ return function wrapInjectable(original) {
62
+ return function wrappedInjectable(options) {
63
+ return function (target) {
64
+ // patch middleware
65
+ if (typeof target.prototype.use === 'function' && !target.__SENTRY_INTERNAL__) {
66
+ // patch only once
67
+ if (isPatched(target)) {
68
+ return original(options)(target);
69
+ }
70
+
71
+ target.prototype.use = new Proxy(target.prototype.use, {
72
+ apply: (originalUse, thisArgUse, argsUse) => {
73
+ const [req, res, next, ...args] = argsUse;
74
+ const prevSpan = getActiveSpan();
75
+
76
+ return startSpanManual(getMiddlewareSpanOptions(target), (span) => {
77
+ const nextProxy = new Proxy(next, {
78
+ apply: (originalNext, thisArgNext, argsNext) => {
79
+ span.end();
80
+
81
+ if (prevSpan) {
82
+ return withActiveSpan(prevSpan, () => {
83
+ return Reflect.apply(originalNext, thisArgNext, argsNext);
84
+ });
85
+ } else {
86
+ return Reflect.apply(originalNext, thisArgNext, argsNext);
87
+ }
88
+ },
89
+ });
90
+
91
+ return originalUse.apply(thisArgUse, [req, res, nextProxy, args]);
92
+ });
93
+ },
94
+ });
95
+ }
96
+
97
+ // patch guards
98
+ if (typeof target.prototype.canActivate === 'function' && !target.__SENTRY_INTERNAL__) {
99
+ // patch only once
100
+ if (isPatched(target)) {
101
+ return original(options)(target);
102
+ }
103
+
104
+ target.prototype.canActivate = new Proxy(target.prototype.canActivate, {
105
+ apply: (originalCanActivate, thisArgCanActivate, argsCanActivate) => {
106
+ return startSpan(getMiddlewareSpanOptions(target), () => {
107
+ return originalCanActivate.apply(thisArgCanActivate, argsCanActivate);
108
+ });
109
+ },
110
+ });
111
+ }
112
+
113
+ // patch pipes
114
+ if (typeof target.prototype.transform === 'function' && !target.__SENTRY_INTERNAL__) {
115
+ if (isPatched(target)) {
116
+ return original(options)(target);
117
+ }
118
+
119
+ target.prototype.transform = new Proxy(target.prototype.transform, {
120
+ apply: (originalTransform, thisArgTransform, argsTransform) => {
121
+ return startSpan(getMiddlewareSpanOptions(target), () => {
122
+ return originalTransform.apply(thisArgTransform, argsTransform);
123
+ });
124
+ },
125
+ });
126
+ }
127
+
128
+ // patch interceptors
129
+ if (typeof target.prototype.intercept === 'function' && !target.__SENTRY_INTERNAL__) {
130
+ if (isPatched(target)) {
131
+ return original(options)(target);
132
+ }
133
+
134
+ target.prototype.intercept = new Proxy(target.prototype.intercept, {
135
+ apply: (originalIntercept, thisArgIntercept, argsIntercept) => {
136
+ const [executionContext, next, args] = argsIntercept;
137
+ const prevSpan = getActiveSpan();
138
+
139
+ return startSpanManual(getMiddlewareSpanOptions(target), (span) => {
140
+ const nextProxy = new Proxy(next, {
141
+ get: (thisArgNext, property, receiver) => {
142
+ if (property === 'handle') {
143
+ const originalHandle = Reflect.get(thisArgNext, property, receiver);
144
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
145
+ return (...args) => {
146
+ span.end();
147
+
148
+ if (prevSpan) {
149
+ return withActiveSpan(prevSpan, () => {
150
+ return Reflect.apply(originalHandle, thisArgNext, args);
151
+ });
152
+ } else {
153
+ return Reflect.apply(originalHandle, thisArgNext, args);
154
+ }
155
+ };
156
+ }
157
+
158
+ return Reflect.get(target, property, receiver);
159
+ },
160
+ });
161
+
162
+ return originalIntercept.apply(thisArgIntercept, [executionContext, nextProxy, args]);
163
+ });
164
+ },
165
+ });
166
+ }
167
+
168
+ return original(options)(target);
169
+ };
170
+ };
171
+ };
172
+ }
173
+ } SentryNestInstrumentation.__initStatic(); SentryNestInstrumentation.__initStatic2();
174
+
175
+ export { SentryNestInstrumentation };
176
+ //# sourceMappingURL=sentry-nest-instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-nest-instrumentation.js","sources":["../../../../../src/integrations/tracing/nest/sentry-nest-instrumentation.ts"],"sourcesContent":["import { isWrapped } from '@opentelemetry/core';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n} from '@opentelemetry/instrumentation';\nimport { getActiveSpan, startSpan, startSpanManual, withActiveSpan } from '@sentry/core';\nimport type { Span } from '@sentry/types';\nimport { SDK_VERSION } from '@sentry/utils';\nimport { getMiddlewareSpanOptions, isPatched } from './helpers';\nimport type { InjectableTarget } from './types';\n\nconst supportedVersions = ['>=8.0.0 <11'];\n\n/**\n * Custom instrumentation for nestjs.\n *\n * This hooks into the @Injectable decorator, which is applied on class middleware, interceptors and guards.\n */\nexport class SentryNestInstrumentation extends InstrumentationBase {\n public static readonly COMPONENT = '@nestjs/common';\n public static readonly COMMON_ATTRIBUTES = {\n component: SentryNestInstrumentation.COMPONENT,\n };\n\n public constructor(config: InstrumentationConfig = {}) {\n super('sentry-nestjs', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationNodeModuleDefinition {\n const moduleDef = new InstrumentationNodeModuleDefinition(SentryNestInstrumentation.COMPONENT, supportedVersions);\n\n moduleDef.files.push(this._getInjectableFileInstrumentation(supportedVersions));\n return moduleDef;\n }\n\n /**\n * Wraps the @Injectable decorator.\n */\n private _getInjectableFileInstrumentation(versions: string[]): InstrumentationNodeModuleFile {\n return new InstrumentationNodeModuleFile(\n '@nestjs/common/decorators/core/injectable.decorator.js',\n versions,\n (moduleExports: { Injectable: InjectableTarget }) => {\n if (isWrapped(moduleExports.Injectable)) {\n this._unwrap(moduleExports, 'Injectable');\n }\n this._wrap(moduleExports, 'Injectable', this._createWrapInjectable());\n return moduleExports;\n },\n (moduleExports: { Injectable: InjectableTarget }) => {\n this._unwrap(moduleExports, 'Injectable');\n },\n );\n }\n\n /**\n * Creates a wrapper function for the @Injectable decorator.\n *\n * Wraps the use method to instrument nest class middleware.\n */\n private _createWrapInjectable() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function wrapInjectable(original: any) {\n return function wrappedInjectable(options?: unknown) {\n return function (target: InjectableTarget) {\n // patch middleware\n if (typeof target.prototype.use === 'function' && !target.__SENTRY_INTERNAL__) {\n // patch only once\n if (isPatched(target)) {\n return original(options)(target);\n }\n\n target.prototype.use = new Proxy(target.prototype.use, {\n apply: (originalUse, thisArgUse, argsUse) => {\n const [req, res, next, ...args] = argsUse;\n const prevSpan = getActiveSpan();\n\n return startSpanManual(getMiddlewareSpanOptions(target), (span: Span) => {\n const nextProxy = new Proxy(next, {\n apply: (originalNext, thisArgNext, argsNext) => {\n span.end();\n\n if (prevSpan) {\n return withActiveSpan(prevSpan, () => {\n return Reflect.apply(originalNext, thisArgNext, argsNext);\n });\n } else {\n return Reflect.apply(originalNext, thisArgNext, argsNext);\n }\n },\n });\n\n return originalUse.apply(thisArgUse, [req, res, nextProxy, args]);\n });\n },\n });\n }\n\n // patch guards\n if (typeof target.prototype.canActivate === 'function' && !target.__SENTRY_INTERNAL__) {\n // patch only once\n if (isPatched(target)) {\n return original(options)(target);\n }\n\n target.prototype.canActivate = new Proxy(target.prototype.canActivate, {\n apply: (originalCanActivate, thisArgCanActivate, argsCanActivate) => {\n return startSpan(getMiddlewareSpanOptions(target), () => {\n return originalCanActivate.apply(thisArgCanActivate, argsCanActivate);\n });\n },\n });\n }\n\n // patch pipes\n if (typeof target.prototype.transform === 'function' && !target.__SENTRY_INTERNAL__) {\n if (isPatched(target)) {\n return original(options)(target);\n }\n\n target.prototype.transform = new Proxy(target.prototype.transform, {\n apply: (originalTransform, thisArgTransform, argsTransform) => {\n return startSpan(getMiddlewareSpanOptions(target), () => {\n return originalTransform.apply(thisArgTransform, argsTransform);\n });\n },\n });\n }\n\n // patch interceptors\n if (typeof target.prototype.intercept === 'function' && !target.__SENTRY_INTERNAL__) {\n if (isPatched(target)) {\n return original(options)(target);\n }\n\n target.prototype.intercept = new Proxy(target.prototype.intercept, {\n apply: (originalIntercept, thisArgIntercept, argsIntercept) => {\n const [executionContext, next, args] = argsIntercept;\n const prevSpan = getActiveSpan();\n\n return startSpanManual(getMiddlewareSpanOptions(target), (span: Span) => {\n const nextProxy = new Proxy(next, {\n get: (thisArgNext, property, receiver) => {\n if (property === 'handle') {\n const originalHandle = Reflect.get(thisArgNext, property, receiver);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (...args: any[]) => {\n span.end();\n\n if (prevSpan) {\n return withActiveSpan(prevSpan, () => {\n return Reflect.apply(originalHandle, thisArgNext, args);\n });\n } else {\n return Reflect.apply(originalHandle, thisArgNext, args);\n }\n };\n }\n\n return Reflect.get(target, property, receiver);\n },\n });\n\n return originalIntercept.apply(thisArgIntercept, [executionContext, nextProxy, args]);\n });\n },\n });\n }\n\n return original(options)(target);\n };\n };\n };\n }\n}\n"],"names":[],"mappings":";;;;;;AAaA,MAAM,iBAAkB,GAAE,CAA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9D,sBAAsB,IAAI,QAAS,KAAI,QAAQ,EAAE;AACjD,wBAAwB,MAAM,cAAA,GAAiB,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAC3F;AACA,wBAAwB,OAAO,CAAC,GAAG,IAAI,KAAY;AACnD,0BAA0B,IAAI,CAAC,GAAG,EAAE,CAAA;AACpC;AACA,0BAA0B,IAAI,QAAQ,EAAE;AACxC,4BAA4B,OAAO,cAAc,CAAC,QAAQ,EAAE,MAAM;AAClE,8BAA8B,OAAO,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;AACrF,6BAA6B,CAAC,CAAA;AAC9B,iCAAiC;AACjC,4BAA4B,OAAO,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;AACnF,2BAA0B;AAC1B,yBAAyB,CAAA;AACzB,uBAAsB;AACtB;AACA,sBAAsB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACpE,qBAAqB;AACrB,mBAAmB,CAAC,CAAA;AACpB;AACA,kBAAkB,OAAO,iBAAiB,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;AACvG,iBAAiB,CAAC,CAAA;AAClB,eAAe;AACf,aAAa,CAAC,CAAA;AACd,WAAU;AACV;AACA,UAAU,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;AAC1C,SAAS,CAAA;AACT,OAAO,CAAA;AACP,KAAK,CAAA;AACL,GAAE;AACF,CAAA,CAAA,yBAAA,CAAA,YAAA,EAAA,CAAA,CAAA,yBAAA,CAAA,aAAA,EAAA;;;;"}
@@ -16,7 +16,7 @@ export { mongooseIntegration } from './integrations/tracing/mongoose';
16
16
  export { mysqlIntegration } from './integrations/tracing/mysql';
17
17
  export { mysql2Integration } from './integrations/tracing/mysql2';
18
18
  export { redisIntegration } from './integrations/tracing/redis';
19
- export { nestIntegration, setupNestErrorHandler } from './integrations/tracing/nest';
19
+ export { nestIntegration, setupNestErrorHandler } from './integrations/tracing/nest/nest';
20
20
  export { postgresIntegration } from './integrations/tracing/postgres';
21
21
  export { prismaIntegration } from './integrations/tracing/prisma';
22
22
  export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi';
@@ -36,6 +36,6 @@ export { cron } from './cron';
36
36
  export type { NodeOptions } from './types';
37
37
  export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/utils';
38
38
  export { addOpenTelemetryInstrumentation, continueTrace, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
39
- export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
39
+ export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, getTraceData, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
40
40
  export type { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, ErrorEvent, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, User, Span, } from '@sentry/types';
41
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAA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B,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,eAAe,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { InjectableTarget } from './types';
2
+ /**
3
+ * Helper checking if a concrete target class is already patched.
4
+ *
5
+ * We already guard duplicate patching with isWrapped. However, isWrapped checks whether a file has been patched, whereas we use this check for concrete target classes.
6
+ * This check might not be necessary, but better to play it safe.
7
+ */
8
+ export declare function isPatched(target: InjectableTarget): boolean;
9
+ /**
10
+ * Returns span options for nest middleware spans.
11
+ */
12
+ export declare function getMiddlewareSpanOptions(target: InjectableTarget): {
13
+ name: string;
14
+ attributes: {
15
+ "sentry.op": string;
16
+ "sentry.origin": string;
17
+ };
18
+ };
19
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAO3D;AAED;;GAEG;AAEH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB;;;;;;EAQhE"}
@@ -0,0 +1,15 @@
1
+ import type { MinimalNestJsApp, NestJsErrorFilter } from './types';
2
+ export declare const instrumentNest: (() => void) & {
3
+ id: string;
4
+ };
5
+ /**
6
+ * Nest framework integration
7
+ *
8
+ * Capture tracing data for nest.
9
+ */
10
+ export declare const nestIntegration: () => import("@sentry/types").Integration;
11
+ /**
12
+ * Setup an error handler for Nest.
13
+ */
14
+ export declare function setupNestErrorHandler(app: MinimalNestJsApp, baseFilter: NestJsErrorFilter): void;
15
+ //# sourceMappingURL=nest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/nest.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAYnE,eAAO,MAAM,cAAc,SACrB,IAAI;;CAKT,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,eAAe,2CAAsC,CAAC;AAEnE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAmDhG"}
@@ -0,0 +1,29 @@
1
+ import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ /**
4
+ * Custom instrumentation for nestjs.
5
+ *
6
+ * This hooks into the @Injectable decorator, which is applied on class middleware, interceptors and guards.
7
+ */
8
+ export declare class SentryNestInstrumentation extends InstrumentationBase {
9
+ static readonly COMPONENT = "@nestjs/common";
10
+ static readonly COMMON_ATTRIBUTES: {
11
+ component: string;
12
+ };
13
+ constructor(config?: InstrumentationConfig);
14
+ /**
15
+ * Initializes the instrumentation by defining the modules to be patched.
16
+ */
17
+ init(): InstrumentationNodeModuleDefinition;
18
+ /**
19
+ * Wraps the @Injectable decorator.
20
+ */
21
+ private _getInjectableFileInstrumentation;
22
+ /**
23
+ * Creates a wrapper function for the @Injectable decorator.
24
+ *
25
+ * Wraps the use method to instrument nest class middleware.
26
+ */
27
+ private _createWrapInjectable;
28
+ }
29
+ //# sourceMappingURL=sentry-nest-instrumentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-nest-instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/sentry-nest-instrumentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EACL,mBAAmB,EACnB,mCAAmC,EAEpC,MAAM,gCAAgC,CAAC;AASxC;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB;IAChE,gBAAuB,SAAS,oBAAoB;IACpD,gBAAuB,iBAAiB;;MAEtC;gBAEiB,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,mCAAmC;IAOlD;;OAEG;IACH,OAAO,CAAC,iCAAiC;IAiBzC;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;CAkH9B"}
@@ -0,0 +1,50 @@
1
+ interface MinimalNestJsExecutionContext {
2
+ getType: () => string;
3
+ switchToHttp: () => {
4
+ getRequest: () => {
5
+ route?: {
6
+ path?: string;
7
+ };
8
+ method?: string;
9
+ };
10
+ };
11
+ }
12
+ export interface NestJsErrorFilter {
13
+ catch(exception: any, host: any): void;
14
+ }
15
+ export interface MinimalNestJsApp {
16
+ useGlobalFilters: (arg0: NestJsErrorFilter) => void;
17
+ useGlobalInterceptors: (interceptor: {
18
+ intercept: (context: MinimalNestJsExecutionContext, next: {
19
+ handle: () => any;
20
+ }) => any;
21
+ }) => void;
22
+ }
23
+ /**
24
+ * A minimal interface for an Observable.
25
+ */
26
+ export interface Observable<T> {
27
+ subscribe(observer: (value: T) => void): void;
28
+ }
29
+ /**
30
+ * A NestJS call handler. Used in interceptors to start the route execution.
31
+ */
32
+ export interface CallHandler {
33
+ handle(...args: any[]): Observable<any>;
34
+ }
35
+ /**
36
+ * Represents an injectable target class in NestJS.
37
+ */
38
+ export interface InjectableTarget {
39
+ name: string;
40
+ sentryPatched?: boolean;
41
+ __SENTRY_INTERNAL__?: boolean;
42
+ prototype: {
43
+ use?: (req: unknown, res: unknown, next: () => void, ...args: any[]) => void;
44
+ canActivate?: (...args: any[]) => boolean | Promise<boolean> | Observable<boolean>;
45
+ transform?: (...args: any[]) => any;
46
+ intercept?: (context: unknown, next: CallHandler, ...args: any[]) => Observable<any>;
47
+ };
48
+ }
49
+ export {};
50
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/types.ts"],"names":[],"mappings":"AAEA,UAAU,6BAA6B;IACrC,OAAO,EAAE,MAAM,MAAM,CAAC;IAEtB,YAAY,EAAE,MAAM;QAIlB,UAAU,EAAE,MAAM;YAChB,KAAK,CAAC,EAAE;gBACN,IAAI,CAAC,EAAE,MAAM,CAAC;aACf,CAAC;YACF,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpD,qBAAqB,EAAE,CAAC,WAAW,EAAE;QACnC,SAAS,EAAE,CAAC,OAAO,EAAE,6BAA6B,EAAE,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,GAAG,CAAA;SAAE,KAAK,GAAG,CAAC;KACzF,KAAK,IAAI,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE;QACT,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;QAC7E,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACnF,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;QACpC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,UAAU,CAAC,GAAG,CAAC,CAAC;KACtF,CAAC;CACH"}
@@ -16,7 +16,7 @@ export { mongooseIntegration } from './integrations/tracing/mongoose';
16
16
  export { mysqlIntegration } from './integrations/tracing/mysql';
17
17
  export { mysql2Integration } from './integrations/tracing/mysql2';
18
18
  export { redisIntegration } from './integrations/tracing/redis';
19
- export { nestIntegration, setupNestErrorHandler } from './integrations/tracing/nest';
19
+ export { nestIntegration, setupNestErrorHandler } from './integrations/tracing/nest/nest';
20
20
  export { postgresIntegration } from './integrations/tracing/postgres';
21
21
  export { prismaIntegration } from './integrations/tracing/prisma';
22
22
  export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi';
@@ -36,6 +36,6 @@ export { cron } from './cron';
36
36
  export { NodeOptions } from './types';
37
37
  export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/utils';
38
38
  export { addOpenTelemetryInstrumentation, continueTrace, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
39
- export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
39
+ export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, getTraceData, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
40
40
  export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, ErrorEvent, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, User, Span, } from '@sentry/types';
41
41
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { InjectableTarget } from './types';
2
+ /**
3
+ * Helper checking if a concrete target class is already patched.
4
+ *
5
+ * We already guard duplicate patching with isWrapped. However, isWrapped checks whether a file has been patched, whereas we use this check for concrete target classes.
6
+ * This check might not be necessary, but better to play it safe.
7
+ */
8
+ export declare function isPatched(target: InjectableTarget): boolean;
9
+ /**
10
+ * Returns span options for nest middleware spans.
11
+ */
12
+ export declare function getMiddlewareSpanOptions(target: InjectableTarget): {
13
+ name: string;
14
+ attributes: {
15
+ "sentry.op": string;
16
+ "sentry.origin": string;
17
+ };
18
+ };
19
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { MinimalNestJsApp, NestJsErrorFilter } from './types';
2
+ export declare const instrumentNest: (() => void) & {
3
+ id: string;
4
+ };
5
+ /**
6
+ * Nest framework integration
7
+ *
8
+ * Capture tracing data for nest.
9
+ */
10
+ export declare const nestIntegration: () => import("@sentry/types").Integration;
11
+ /**
12
+ * Setup an error handler for Nest.
13
+ */
14
+ export declare function setupNestErrorHandler(app: MinimalNestJsApp, baseFilter: NestJsErrorFilter): void;
15
+ //# sourceMappingURL=nest.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ /**
4
+ * Custom instrumentation for nestjs.
5
+ *
6
+ * This hooks into the @Injectable decorator, which is applied on class middleware, interceptors and guards.
7
+ */
8
+ export declare class SentryNestInstrumentation extends InstrumentationBase {
9
+ static readonly COMPONENT = "@nestjs/common";
10
+ static readonly COMMON_ATTRIBUTES: {
11
+ component: string;
12
+ };
13
+ constructor(config?: InstrumentationConfig);
14
+ /**
15
+ * Initializes the instrumentation by defining the modules to be patched.
16
+ */
17
+ init(): InstrumentationNodeModuleDefinition;
18
+ /**
19
+ * Wraps the @Injectable decorator.
20
+ */
21
+ private _getInjectableFileInstrumentation;
22
+ /**
23
+ * Creates a wrapper function for the @Injectable decorator.
24
+ *
25
+ * Wraps the use method to instrument nest class middleware.
26
+ */
27
+ private _createWrapInjectable;
28
+ }
29
+ //# sourceMappingURL=sentry-nest-instrumentation.d.ts.map
@@ -0,0 +1,50 @@
1
+ interface MinimalNestJsExecutionContext {
2
+ getType: () => string;
3
+ switchToHttp: () => {
4
+ getRequest: () => {
5
+ route?: {
6
+ path?: string;
7
+ };
8
+ method?: string;
9
+ };
10
+ };
11
+ }
12
+ export interface NestJsErrorFilter {
13
+ catch(exception: any, host: any): void;
14
+ }
15
+ export interface MinimalNestJsApp {
16
+ useGlobalFilters: (arg0: NestJsErrorFilter) => void;
17
+ useGlobalInterceptors: (interceptor: {
18
+ intercept: (context: MinimalNestJsExecutionContext, next: {
19
+ handle: () => any;
20
+ }) => any;
21
+ }) => void;
22
+ }
23
+ /**
24
+ * A minimal interface for an Observable.
25
+ */
26
+ export interface Observable<T> {
27
+ subscribe(observer: (value: T) => void): void;
28
+ }
29
+ /**
30
+ * A NestJS call handler. Used in interceptors to start the route execution.
31
+ */
32
+ export interface CallHandler {
33
+ handle(...args: any[]): Observable<any>;
34
+ }
35
+ /**
36
+ * Represents an injectable target class in NestJS.
37
+ */
38
+ export interface InjectableTarget {
39
+ name: string;
40
+ sentryPatched?: boolean;
41
+ __SENTRY_INTERNAL__?: boolean;
42
+ prototype: {
43
+ use?: (req: unknown, res: unknown, next: () => void, ...args: any[]) => void;
44
+ canActivate?: (...args: any[]) => boolean | Promise<boolean> | Observable<boolean>;
45
+ transform?: (...args: any[]) => any;
46
+ intercept?: (context: unknown, next: CallHandler, ...args: any[]) => Observable<any>;
47
+ };
48
+ }
49
+ export {};
50
+ //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "8.21.0",
3
+ "version": "8.23.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -88,10 +88,10 @@
88
88
  "@opentelemetry/sdk-trace-base": "^1.25.1",
89
89
  "@opentelemetry/semantic-conventions": "^1.25.1",
90
90
  "@prisma/instrumentation": "5.17.0",
91
- "@sentry/core": "8.21.0",
92
- "@sentry/opentelemetry": "8.21.0",
93
- "@sentry/types": "8.21.0",
94
- "@sentry/utils": "8.21.0",
91
+ "@sentry/core": "8.23.0",
92
+ "@sentry/opentelemetry": "8.23.0",
93
+ "@sentry/types": "8.23.0",
94
+ "@sentry/utils": "8.23.0",
95
95
  "import-in-the-middle": "^1.11.0"
96
96
  },
97
97
  "devDependencies": {