Skip to content

Connectum API Reference / @connectum/otel / shared / markSpanFailed

Function: markSpanFailed() ​

markSpanFailed(span, error, side): Record<string, string>

Defined in: shared.ts:294

Marks a span as failed by the error a call ended with: the failure itself (status and exception, see recordFailure) and the error attributes of buildErrorAttributes. The span status becomes ERROR for every failure of a client span, and for a server span only when isServerErrorStatus says so. It does not end the span. Never throws.

Parameters ​

span ​

Span

The span of the call

error ​

unknown

The error, exactly as caught

side ​

"server" | "client"

Which side of the call the span belongs to

Returns ​

Record<string, string>

The error attributes, for the metric points of the same call