Adi
09/23/2022, 10:03 AM${attributes['http.method']} ${attributes['http.url']}
)
}
if (result instanceof Error) {
span.setStatus({
code: SpanStatusCode.ERROR,
message: result.message
})
span.recordException(result.stack || result.name)
}
}
})
]
})
export function traceSpan<F extends (...args: any) => ReturnType<F>>(
name: string,
func: F
): ReturnType<F> {
let singleSpan: Span
if (bindingSpan) {
const ctx = trace.setSpan(context.active(), bindingSpan)
singleSpan = webTracerWithZone.startSpan(name, undefined, ctx)
bindingSpan = undefined
} else {
singleSpan = webTracerWithZone.startSpan(name)
}
return context.with(trace.setSpan(context.active(), singleSpan), () => {
try {
const result = func()
singleSpan.end()
return result
} catch (error) {
singleSpan.setStatus({ code: SpanStatusCode.ERROR })
singleSpan.end()
throw error
}
})
}
Is there any idea about how to solve this?Vishal Sharma
09/23/2022, 11:14 AMPalash Gupta
09/23/2022, 11:24 AMAdi
09/26/2022, 1:40 AMPalash Gupta
09/26/2022, 3:36 AMAdi
09/26/2022, 9:11 AMPalash Gupta
09/26/2022, 10:40 AMwindow
&& your script
would work ?