Skip to content

Rename submodule export from setup #13589

Open
Open
@nicohrubec

Description

@nicohrubec

The setup.ts file in our NestJS SDK relies on imports from @nestjs/core and @nestjs/common. This initially led to problems with our otel instrumentation, because the NestJS packages were being imported in applications before we could call Sentry.init, leading to the standard @nestjs/core otel instrumentation not being loaded properly.

We solved this by adding a submodule export @sentry/nestjs/setup for the setup.ts file. However, the naming of this might be a bit confusing to users or specifically what should be imported from this submodule export vs the non-submodule export. One idea for a rename would be module, since the file actually mainly exports the SentryModule. This would require to also rename the setup.ts file, because the name of the file and submodule path must be identical for some reason.

Additional Note:
Originally the SentryModule also included the global error filters provided by Sentry (SentryGlobalFilter and SentryGlobalGraphQLFilter). For this reason these filters still live in this file. However, these filters are no longer part of the SentryModule, meaning that we could potentially looking into moving these error filters to a separate file, which would then allow us to export them from @sentry/nestjs instead of @sentry/nestjs/setup.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions