From d64e0c455c15c036cf4db7b219970ad021cb1e2a Mon Sep 17 00:00:00 2001 From: ks1ksi Date: Thu, 2 Nov 2023 20:05:51 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Update:=20sentry=20transac?= =?UTF-8?q?tion=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # --- src/interceptors/sentry.interceptor.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/interceptors/sentry.interceptor.ts b/src/interceptors/sentry.interceptor.ts index 99c6e9f..cf500a4 100644 --- a/src/interceptors/sentry.interceptor.ts +++ b/src/interceptors/sentry.interceptor.ts @@ -12,13 +12,24 @@ export class SentryInterceptor implements NestInterceptor { intercept(context: ExecutionContext, next: CallHandler): Observable { const request = context.switchToHttp().getRequest(); + const handler = context.getHandler(); + const ct = context.getClass(); + + const handlerName = handler?.name; + const controllerName = ct?.name; + + const transactionName = `${controllerName}.${handlerName}`; + const span = Sentry.startTransaction({ op: 'http', - name: request.url, + name: transactionName, data: { headers: request.headers, method: request.method, url: request.url, + query: request.query, + params: request.params, + body: request.body, }, });