Skip to content

nimgent/tracing

This page is generated from the module’s exported API and ## documentation comments.

Provider-neutral tracing primitives.

Operation category recorded in a trace span.

SpanKind = enum
skRun, skStep, skModel, skTool, skEmbedding

View source

Completion status recorded in a trace span.

SpanStatus = enum
ssOk, ssError, ssCancelled

View source

Completed span emitted to a TraceSink. Content is never included unless an application explicitly adds it to attributes.

TraceSpan = ref object
traceId*: string
spanId*: string
parentSpanId*: string
name*: string
kind*: SpanKind
startNs*: int64
endNs*: int64
status*: SpanStatus
attributes*: JsonNode
error*: string

View source

Callback that receives each completed span.

TraceSink = proc (span: TraceSpan) {.closure.}

View source

Return a completed span’s duration in milliseconds.

proc durationMs(span: TraceSpan): int {.raises: [], tags: [], forbids: [].}

Returns: int.

Name Type Default
span TraceSpan

View source