Skip to content

Commit

Permalink
⚡️ Update: sentry transaction 이름 변경
Browse files Browse the repository at this point in the history
#
  • Loading branch information
ks1ksi committed Nov 2, 2023
1 parent 8a9349e commit d64e0c4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/interceptors/sentry.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@ export class SentryInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
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,
},
});

Expand Down

0 comments on commit d64e0c4

Please sign in to comment.