You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Learn about instrumenting NestJS event-based services."
4
+
---
5
+
6
+
<Note>
7
+
The @nestjs/event-emitter module is auto-instrumented in `@sentry/nestjs` 8.39.0 and up.
8
+
</Note>
9
+
10
+
The NestJS SDK wraps the `@OnEvent` decorator automatically to:
11
+
12
+
- Create performance traces for event handler executions.
13
+
- Automatically capture any unhandled exceptions that occur in event handlers.
14
+
- Maintain visibility into asynchronous event-driven flows.
15
+
16
+
When an event handler is executed, a new span is created to track its performance, and any errors are automatically reported to Sentry while preserving the original error behavior.
17
+
18
+
This instrumentation works transparently with existing NestJS event handlers without requiring any code changes to your application.
Copy file name to clipboardExpand all lines: platform-includes/getting-started-use/javascript.nestjs.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ export class YourCatchAllExceptionFilter implements ExceptionFilter {
49
49
}
50
50
```
51
51
52
+
52
53
{/* TODO(v9): Remove this note */}
53
54
_Note that `@SentryExceptionCaptured()` was called `@WithSentry` in SDK versions `8.38.0` and prior._
54
55
@@ -72,7 +73,6 @@ import { SentryGlobalFilter } from "@sentry/nestjs/setup";
72
73
})
73
74
exportclassAppModule {}
74
75
```
75
-
76
76
{/* TODO(v9): Remove this note. */}
77
77
78
78
**Note:** If you have a NestJS + GraphQL application and you are using the `@sentry/nestjs` SDK version `8.38.0` or earlier, replace the `SentryGlobalFilter` with the `SentryGlobalGenericFilter`.
0 commit comments