-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor to use scopes more cleanly (request-scoped provider?) #22
Comments
I would love to add support for breadcrumbs and messages. I was giving this a try before but couldn't find a good solution. Injection Scopes look like a good solution [1]. Will look in to it over the weekend. If you want you can create some POC. One thing that we need to be careful is the performance impact. |
Cool--this should make breadcrumbs and messages easier too, for sure. Performance impact of request-scoped stuff is negligible, in my experience. I wrote @eropple/nestjs-bunyan, which effectively makes your entire application, request-scoped and it has no meaningful performance impact. And a lot of other frameworks, like .NET's ASP.NET, are request-scoped by default. I can try to get to this one this week, if you don't get there first. |
Any updates on this? How's the milestone going? @mentos1386 |
@farzadso moved to v7.0.0. I'm sadly not involved in NestJS world anymore, so it's hard for me to work on something that i don't use. I will try to find a new maintainer to push this project forward. v6.0.0 will be released without this changes as it has some other improvements that should be released a while ago. |
Thanks for the update @mentos1386 I hope you can find a maintainer as we are considering using your library in our new project. |
@9renpoto would you be willing to work on this? |
I'm not using this library (as I just discovered it) but I think adding breadcrumb support is pretty easy with the current interceptor the library already implements and without requiring request scoping. We changed our custom Sentry integration to look like this:
It appears to be working properly and capturing breadcrumbs properly for specific requests |
Looking at this again, the @kdubb solution is correct one. We would have to fix our interceptor to similarly to use the scope at the beginning of request, and add some tags on it. This should be very small and backwards-compatible change. |
There are cases where one may want to send additional events to Sentry besides an exception--it's a pretty common pattern. However, right now, the scope is generated on-demand when an exception is captured and there's no way to get that data from the interceptor.
So, two suggestions:
Scope.REQUEST
scope that creates, and returns, aSentry.Hub
(exposing it for import in user modules). This hub's default scope (Sentry scope, not NestJS scope) should be populated with request information at the start of the request and be available through its lifecycle.I may be able to help with this if it's of interest. Thoughts?
The text was updated successfully, but these errors were encountered: