eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 534 B
JavaScript
import{SpanStatusCode}from"#compiled/@opentelemetry/api/index.js";import{truncateTelemetryText}from"#tracing/telemetry-budget.js";import{boundedTraceError}from"#tracing/bounded-error.js";function recordAgentSpanError(e,t,n){if(e.setAttribute(`error.type`,truncateTelemetryText(n??(t instanceof Error?t.name||`Error`:`_OTHER`),128)),t instanceof Error){let n=boundedTraceError(t);e.recordException(n),e.setStatus({code:SpanStatusCode.ERROR,message:n.message})}else e.setStatus({code:SpanStatusCode.ERROR})}export{recordAgentSpanError};