File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/traceloop-sdk/src/lib/tracing Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ const AI_USAGE_PROMPT_TOKENS = "ai.usage.promptTokens";
1414const AI_USAGE_COMPLETION_TOKENS = "ai.usage.completionTokens" ;
1515const AI_MODEL_PROVIDER = "ai.model.provider" ;
1616
17-
18-
1917export const transformAiSdkSpanName = ( span : ReadableSpan ) : void => {
20- // Unfortunately, the span name is not writable as this is not the intended behavior
21- // but it is a workaround to set the correct span name
18+ // Unfortunately, the span name is not writable as this is not the intended behavior
19+ // but it is a workaround to set the correct span name
20+ if ( span . name in HANDLED_SPAN_NAMES ) {
2221 ( span as any ) . name = HANDLED_SPAN_NAMES [ span . name ] ;
22+ }
2323} ;
2424
2525export const transformResponseText = (
@@ -114,7 +114,7 @@ export const shouldHandleSpan = (span: ReadableSpan): boolean => {
114114export const transformAiSdkSpan = ( span : ReadableSpan ) : void => {
115115 if ( ! shouldHandleSpan ( span ) ) {
116116 return ;
117- }
117+ }
118118 transformAiSdkSpanName ( span ) ;
119119 transformAiSdkAttributes ( span . attributes ) ;
120120} ;
You can’t perform that action at this time.
0 commit comments