File tree Expand file tree Collapse file tree
packages/core/src/tracing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ function instrumentMethod<T extends unknown[], R>(
265265) : ( ...args : T ) => R | Promise < R > {
266266 return new Proxy ( originalMethod , {
267267 apply ( target , thisArg , args : T ) : R | Promise < R > {
268- const operationName = instrumentedMethod . operation as string ;
268+ const operationName = instrumentedMethod . operation || 'unknown' ;
269269 const requestAttributes = extractRequestAttributes ( args , methodPath , operationName ) ;
270270 const model = requestAttributes [ GEN_AI_REQUEST_MODEL_ATTRIBUTE ] ?? 'unknown' ;
271271
Original file line number Diff line number Diff line change @@ -268,7 +268,7 @@ function instrumentMethod<T extends unknown[], R>(
268268
269269 return new Proxy ( originalMethod , {
270270 apply ( target , _ , args : T ) : R | Promise < R > {
271- const operationName = instrumentedMethod . operation as string ;
271+ const operationName = instrumentedMethod . operation || 'unknown' ;
272272 const params = args [ 0 ] as Record < string , unknown > | undefined ;
273273 const requestAttributes = extractRequestAttributes ( operationName , params , context ) ;
274274 const model = requestAttributes [ GEN_AI_REQUEST_MODEL_ATTRIBUTE ] ?? 'unknown' ;
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ function instrumentMethod<T extends unknown[], R>(
180180 options : OpenAiOptions ,
181181) : ( ...args : T ) => Promise < R > {
182182 return function instrumentedCall ( ...args : T ) : Promise < R > {
183- const operationName = instrumentedMethod . operation as string ;
183+ const operationName = instrumentedMethod . operation || 'unknown' ;
184184 const requestAttributes = extractRequestAttributes ( args , operationName ) ;
185185 const model = ( requestAttributes [ GEN_AI_REQUEST_MODEL_ATTRIBUTE ] as string ) || 'unknown' ;
186186
You can’t perform that action at this time.
0 commit comments