Add sentry tracing (#4279)
* Add sentry tracign * Improve Sentry loggin
This commit is contained in:
@ -2,6 +2,7 @@ import { NestFactory } from '@nestjs/core';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||
|
||||
import * as Sentry from '@sentry/node';
|
||||
import { graphqlUploadExpress } from 'graphql-upload';
|
||||
import bytes from 'bytes';
|
||||
import { useContainer } from 'class-validator';
|
||||
@ -27,6 +28,11 @@ const bootstrap = async () => {
|
||||
// Use our logger
|
||||
app.useLogger(logger);
|
||||
|
||||
if (Sentry.isInitialized()) {
|
||||
app.use(Sentry.Handlers.requestHandler());
|
||||
app.use(Sentry.Handlers.tracingHandler());
|
||||
}
|
||||
|
||||
// Apply validation pipes globally
|
||||
app.useGlobalPipes(
|
||||
new ValidationPipe({
|
||||
|
||||
Reference in New Issue
Block a user