You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my interceptor where I do context.getHandler().name:
import{Injectable,NestInterceptor,ExecutionContext,CallHandler}from'@nestjs/common';import{PinoLogger}from'nestjs-pino';import{Observable}from'rxjs';import{tap}from'rxjs/operators';
@Injectable()exportclassLoggingInterceptorimplementsNestInterceptor{constructor(privatereadonlylogger: PinoLogger){}intercept(context: ExecutionContext,next: CallHandler): Observable<any>{constcontroller=context.getClass().name;consthandler=context.getHandler().name;// Here is the isse, I expect the name of the method, but I get `PropertyDescriptor` insteadthis.logger.info(`Before... ${controller}${handler}`);constnow=Date.now();returnnext.handle().pipe(tap(()=>this.logger.info(`After... ${Date.now()-now}ms ${controller}${handler}`)),);}}
I expect the log MovieController list but I get MovieController PropertyDescriptor instead:
I have a controller method annotated with
@Span
:This is my interceptor where I do context.getHandler().name:
I expect the log
MovieController list
but I getMovieController PropertyDescriptor
instead:Here is the minimum reproduction repo: https://github.com/snigdha920/nestjs-otel-prom-grafana-tempo
Think the issue happens here:
nestjs-otel/src/tracing/decorators/span.ts
Line 12 in 9517109
wrappedFunction
's name correctlyThe text was updated successfully, but these errors were encountered: