Open mydea opened 4 months ago
Few things I would like to add
@rubiin care to elaborate a bit? What kind of options should it take?
we are using a separate file for initializing sentry. The module should take all the options required and do that initializing inside the module itself.
Here we are using instrument.js
for that https://docs.sentry.io/platforms/javascript/guides/nestjs/
This would allow the support for .forRootAsync
which is currently missing.
For reference you could look at the library https://github.com/ntegral/nestjs-sentry. Since this is the most used integration for nestjs and sentry, if the official integration made the implementation similar, the migration would be easier and also make future enhancements easy
import { Module } from '@nestjs-common';
import { SentryModule } from '@ntegral/nestjs-sentry';
@Module({
imports: [
SentryModule.forRoot({
dsn: 'sentry_io_dsn',
debug: true | false,
environment: 'dev' | 'production' | 'some_environment',
release: 'some_release', | null, // must create a release in sentry.io dashboard
logLevels: ['debug'] //based on sentry.io loglevel //
}),
],
})
export class AppModule {}
Hi, unfortunately, this approach will run into many many problems which I will not outline in detail here but TLDR in order to be able to automatically instrument a bunch of things Sentry needs to run as soon as possible. This is not possible with such an API. @ntegral/nestjs-sentry
is depending on a very old SDK version that doesn't do a lot of the automatic magic that requires the SDK to run early.
In the end it comes down to aesthetic preference for you, and aesthetics isn't really what we're after with the SDK. But I still respect and appreciate the feedback! 🙏
@lforst thats okay . Main concern was rather dependency injection of config service, the aesthetics don't matter rn Will try to cookup an example , perhaps that can be included on the docs
We have shipped
@sentry/nestjs
as Beta. However, there are some follow up tasks we want to do:ARCHIVE - All of this is already done
We do have support for Nest.js through
@sentry/node
today: https://docs.sentry.io/platforms/javascript/guides/nestjs/However, there are some limitations to this, which we could overcome and improve upon if we had a dedicated package for Nest support.