Skip to content

Commit 8cc324c

Browse files
authored
1 parent b5b0b32 commit 8cc324c

File tree

5 files changed

+15
-310
lines changed

5 files changed

+15
-310
lines changed

dev-packages/e2e-tests/test-applications/nestjs-fastify/tests/transactions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ test('Sends an API route transaction', async ({ baseURL }) => {
9797
component: '@nestjs/core',
9898
'nestjs.version': expect.any(String),
9999
'nestjs.type': 'request_context',
100-
'http.request.method': 'GET',
100+
'http.method': 'GET',
101101
'http.url': '/test-transaction',
102102
'http.route': '/test-transaction',
103103
'nestjs.controller': 'AppController',

packages/nestjs/src/decorators.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,18 @@ function copyFunctionNameAndMetadata({
110110
});
111111

112112
// copy metadata
113+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
114+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
113115
if (typeof Reflect !== 'undefined' && typeof Reflect.getMetadataKeys === 'function') {
116+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
117+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
114118
const originalMetaData = Reflect.getMetadataKeys(originalMethod);
115119
for (const key of originalMetaData) {
120+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
121+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
116122
const value = Reflect.getMetadata(key, originalMethod);
123+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
124+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
117125
Reflect.defineMetadata(key, value, descriptor.value);
118126
}
119127
}

packages/nestjs/src/integrations/nest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import { NestInstrumentation as NestInstrumentationCore } from '@opentelemetry/instrumentation-nestjs-core';
12
import { defineIntegration } from '@sentry/core';
23
import { generateInstrumentOnce } from '@sentry/node';
3-
import { NestInstrumentation } from './sentry-nest-core-instrumentation';
44
import { SentryNestEventInstrumentation } from './sentry-nest-event-instrumentation';
55
import { SentryNestInstrumentation } from './sentry-nest-instrumentation';
66

77
const INTEGRATION_NAME = 'Nest';
88

99
const instrumentNestCore = generateInstrumentOnce('Nest-Core', () => {
10-
return new NestInstrumentation();
10+
return new NestInstrumentationCore();
1111
});
1212

1313
const instrumentNestCommon = generateInstrumentOnce('Nest-Common', () => {

packages/nestjs/src/integrations/sentry-nest-core-instrumentation.ts

Lines changed: 0 additions & 307 deletions
This file was deleted.

packages/nestjs/src/integrations/sentry-nest-event-instrumentation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ export class SentryNestEventInstrumentation extends InstrumentationBase {
8383
descriptor.value = async function (...args: unknown[]) {
8484
// When multiple @OnEvent decorators are used on a single method, we need to get all event names
8585
// from the reflector metadata as there is no information during execution which event triggered it
86+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
87+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
8688
if (Reflect.getMetadataKeys(descriptor.value).includes('EVENT_LISTENER_METADATA')) {
89+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
90+
// @ts-ignore - reflect-metadata of nestjs adds these methods to Reflect
8791
const eventData = Reflect.getMetadata('EVENT_LISTENER_METADATA', descriptor.value);
8892
if (Array.isArray(eventData)) {
8993
eventName = eventData

0 commit comments

Comments
 (0)