@@ -60,17 +60,21 @@ function withEntity<
60
60
span . setAttribute ( SpanAttributes . TRACELOOP_ENTITY_NAME , name ) ;
61
61
62
62
if ( shouldSendTraces ( ) ) {
63
- const input = inputParameters ?? args ;
64
- if ( input . length === 1 && typeof input [ 0 ] === "object" ) {
65
- span . setAttribute (
66
- SpanAttributes . TRACELOOP_ENTITY_INPUT ,
67
- JSON . stringify ( { args : [ ] , kwargs : input [ 0 ] } ) ,
68
- ) ;
69
- } else {
70
- span . setAttribute (
71
- SpanAttributes . TRACELOOP_ENTITY_INPUT ,
72
- JSON . stringify ( { args : input , kwargs : { } } ) ,
73
- ) ;
63
+ try {
64
+ const input = inputParameters ?? args ;
65
+ if ( input . length === 1 && typeof input [ 0 ] === "object" ) {
66
+ span . setAttribute (
67
+ SpanAttributes . TRACELOOP_ENTITY_INPUT ,
68
+ JSON . stringify ( { args : [ ] , kwargs : input [ 0 ] } ) ,
69
+ ) ;
70
+ } else {
71
+ span . setAttribute (
72
+ SpanAttributes . TRACELOOP_ENTITY_INPUT ,
73
+ JSON . stringify ( { args : input , kwargs : { } } ) ,
74
+ ) ;
75
+ }
76
+ } catch {
77
+ /* empty */
74
78
}
75
79
}
76
80
@@ -123,10 +127,6 @@ export function withTask<
123
127
A extends unknown [ ] ,
124
128
F extends ( ...args : A ) => ReturnType < F > ,
125
129
> ( config : DecoratorConfig , fn : F , ...args : A ) {
126
- console . log (
127
- "Warning: this way of calling `withTask` is deprecated. " +
128
- "Check out https://www.traceloop.com/docs/openllmetry/tracing/annotations#workflows-and-tasks" ,
129
- ) ;
130
130
return withEntity (
131
131
TraceloopSpanKindValues . TASK ,
132
132
config ,
0 commit comments