trace.current_span_id

Return this invocation's own span ID, never an ancestor's. Hidden, timing-only, and tracing-disabled invocations return null. Reading the ID does not create or promote a span.

Reference version

Signature

function trace.current_span_id() -> trace.SpanId | null throws never

Return this invocation's own span ID, never an ancestor's. Hidden, timing-only, and tracing-disabled invocations return null. Reading the ID does not create or promote a span.

Source:<builtin>/trace/trace.bamlbytes 4715–4788