getsentry / getsentry/sentry-javascript

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

Đang mở
#13,517 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Improvement Nest.js
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

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`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.