@@ -10,6 +10,7 @@ import { waMonitor } from './whatsapp/whatsapp.module';
1010import { HttpStatus , router } from './whatsapp/routers/index.router' ;
1111import 'express-async-errors' ;
1212import { ServerUP } from './utils/server-up' ;
13+ import * as Sentry from '@sentry/node' ;
1314
1415function initWA ( ) {
1516 waMonitor . loadInstance ( ) ;
@@ -19,6 +20,27 @@ function bootstrap() {
1920 const logger = new Logger ( 'SERVER' ) ;
2021 const app = express ( ) ;
2122
23+ // Sentry.init({
24+ // dsn: '',
25+ // integrations: [
26+ // // enable HTTP calls tracing
27+ // new Sentry.Integrations.Http({ tracing: true }),
28+ // // enable Express.js middleware tracing
29+ // new Sentry.Integrations.Express({ app }),
30+ // // Automatically instrument Node.js libraries and frameworks
31+ // ...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
32+ // ],
33+
34+ // // Set tracesSampleRate to 1.0 to capture 100%
35+ // // of transactions for performance monitoring.
36+ // // We recommend adjusting this value in production
37+ // tracesSampleRate: 1.0,
38+ // });
39+
40+ // app.use(Sentry.Handlers.requestHandler());
41+
42+ // app.use(Sentry.Handlers.tracingHandler());
43+
2244 app . use (
2345 cors ( {
2446 origin ( requestOrigin , callback ) {
@@ -43,6 +65,13 @@ function bootstrap() {
4365
4466 app . use ( '/' , router ) ;
4567
68+ // app.use(Sentry.Handlers.errorHandler());
69+
70+ // app.use(function onError(err, req, res, next) {
71+ // res.statusCode = 500;
72+ // res.end(res.sentry + '\n');
73+ // });
74+
4675 app . use (
4776 ( err : Error , req : Request , res : Response , next : NextFunction ) => {
4877 if ( err ) {
0 commit comments