def Context.root

bend-trace-context@0.2.0.0 · generation.bend:52

import bend-trace-context@0.2.0.0/generation.bend as Generation
import Base
import bend-trace-context@0.2.0.0/trace_context.bend as TC

52# Start a trace: a trace ID, then a span ID, as TC.Context.root_with composes
53# them, with the sampled indication `sampled`, as it is given. The trace ID
54# asserts random-trace-id, so the root is emitted with flags 03 when it is
55# sampled and 02 when it is not: False gives an unsampled root, as
56# Context.continue_or_start starts one by default.
57def Context.root(sampled: Bool) -> IO(Result<&2, &2, TC.GenerationError, TC.LocalContext>):
58  on_host(Result<&2, &2, TC.GenerationError, TC.LocalContext>,
59    TC.Context.root_with(~Unit, ~Source.host, Unit{}, sampled))

Uses (9)

Used by (0)

No other definition uses this definition.