trace.Options

Immutable, reusable tracing options. Builders leave their receiver unchanged.

Reference version

Signature

class trace.Options

Immutable, reusable tracing options. Builders leave their receiver unchanged.

Source:<builtin>/trace/trace.bamlbytes 1254–3030

Fields

_handle

$rust_type

Instance methods

function

_span

(
self,
inputs: bool | null,
output: bool | null,
error: bool | null
) -> trace.Options throws never
function

context

(
self,
metadata: map<string, string | int | float | bool | null> = …,
distinct_id: string | null = …
) -> trace.Options throws never

Compose a shallow patch without reading ambient context.

function

empty_span

(self) -> trace.Options throws never

Select Span mode without requesting value capture. Applicable function-policy requests still capture values.

function

inspect

(self) -> trace.Settings throws never

Return a detached snapshot. Mutating it does not change these options.

function

mode

(self, mode: trace.Mode | null) -> trace.Options throws never

Change only mode. Null restores the function's default mode.

function

reserve

(self) -> trace.ReservedSpan throws never

Snapshot these options, select Span mode, and reserve one invocation's ID. The reservation can cross threads within this runtime, not into another runtime. Reattaching the same reservation, including through an alias, is an error.

function

span

(
self,
inputs: bool | null = …,
output: bool | null = …,
error: bool | null = …
) -> trace.Options throws never

Select Span mode and replace all three capture requests. Capture outputs and errors by default; inputs require an explicit request.