getsentry / getsentry/sentry-javascript

Add automatic instrumentation to @sentry/nestjs where `@Injectable` is not used

未关闭
#13,517 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Improvement Nest.js
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
515

描述

Currently the following automatic instrumentations rely on users putting `@Injectable` on top of their implementations:

* Middleware
* Interceptors
* Pipes
* Guards

The problem with this approach is that, even though the nestjs docs say you need the decorator for these constructs, they work fine without if they do not rely on other dependencies being injected. [ref]() Currently these would not get instrumented without the decorator and users would have to manual instrumentation.

Solution Brainstorm:
There is several other places we can monkey-patch to make this more robust.

* core/nest-application.ts: contains API like `app.useGlobalFilters`, `app.use`, `app.useInterceptors`
* other decorators that can be put directly on controllers and get implementations as input: `@UseFilters`, `@Useinterceptors`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。