import{context as c}from"@opentelemetry/api";import{telemetry as e}from"../index.js";async function l(t,o){const r=e.tracer.traceStep(t);r&&e.addTraceStepCallbacks(t,{error:r.error.bind(r),end:r.end.bind(r)});try{return await c.with(r?.context??c.active(),async()=>await o(r))}catch(a){throw r?.error(a),a}finally{e.removeTraceStepCallbacks(t),r?.end()}}export{l as telemetryTraceStep};
