Add sentry tracing (#4279)

* Add sentry tracign

* Improve Sentry loggin
This commit is contained in:
Félix Malfait
2024-03-04 16:31:15 +01:00
committed by GitHub
parent 63d403454c
commit 6d70540cdc
11 changed files with 113 additions and 31 deletions

View File

@ -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({