Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Refactor to use scopes more cleanly (request-scoped provider?) #22

@eropple

Description

@eropple

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:

  • Add a factory-scoped provider in Scope.REQUEST scope that creates, and returns, a Sentry.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.
  • Refactor the interceptor to use this hub.

I may be able to help with this if it's of interest. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions