File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
packages/core/src/utils/anthropic-ai Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -210,8 +210,6 @@ function instrumentMethod<T extends unknown[], R>(
210210 const isStreamingMethod = methodPath === 'messages.stream' ;
211211
212212 if ( isStreamRequested || isStreamingMethod ) {
213- const messageStream = target . apply ( context , args ) ;
214-
215213 // Create span for instrumentation using startSpanManual
216214 return startSpanManual (
217215 {
@@ -225,6 +223,7 @@ function instrumentMethod<T extends unknown[], R>(
225223 addPrivateRequestAttributes ( span , params ) ;
226224 }
227225
226+ const messageStream = target . apply ( context , args ) ;
228227 return instrumentStream ( messageStream , span , options . recordOutputs ?? false ) ;
229228 } catch ( error ) {
230229 span . setStatus ( { code : SPAN_STATUS_ERROR , message : 'internal_error' } ) ;
You can’t perform that action at this time.
0 commit comments