Open nicohrubec opened 2 months ago
The SentryGlobalFilter
still extends the BaseExceptionFilter
as exported from @nestjs/core
, so I don't think we can move these filters out of the setup submodule export as outlined in the issue description. We can still think about renaming the export. However, I don't think the current naming is bad.
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 callSentry.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 thesetup.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 bemodule
, since the file actually mainly exports theSentryModule
. This would require to also rename thesetup.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
andSentryGlobalGraphQLFilter
). For this reason these filters still live in this file. However, these filters are no longer part of theSentryModule
, 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
.