silk.wasm.trace_bridge.
Bidirectional live OpenTelemetry tracing bridge for silk.wasm.bindgen (TracingMode.Live).
Details#
Imported ONLY by generated glue modules built with TracingMode.Live. When TracingMode.Off
is selected, no Effect.provideAmbient<Tracer> exists anywhere in the program so Silk's
TRACE-001 elision removes all tracing code and zero silk_trace#* imports appear in the
resulting WebAssembly module.
Import as TraceRuntime with import silk.wasm.trace_bridge { TraceRuntime }.
Public declarations: 3.
HostTracer#
pub struct HostTracerAmbient Tracer provider forwarding Silk spans live to the JavaScript/Effect host tracer.
Implementation Copy for HostTracer#
impl Copy for HostTracerImplementation Transferable for HostTracer#
impl Transferable for HostTracerImplementation Concurrent for HostTracer#
impl Concurrent for HostTracerImplementation Tracer for HostTracer#
impl Tracer for HostTracerOperation enter#
effect fn enter<Args>(
self: &Self,
static name: string<'static>,
static kind: SpanKind,
static place: Place,
args: &Args,
remote: Option<SpanContext>,
) -> ()Operation exit#
effect fn exit(self: &Self) -> ()Operation cancelled#
effect fn cancelled(self: &Self) -> ()Operation failed#
effect fn failed(self: &Self, static error: string<'static>) -> ()Operation attribute#
effect fn attribute<V>(self: &Self, static key: string<'static>, value: &V) -> ()Operation event#
effect fn event<Args>(self: &Self, static name: string<'static>, args: &Args) -> ()Operation recordError#
effect fn recordError<V>(self: &Self, value: &V) -> ()Operation link#
effect fn link(self: &Self, context: &SpanContext) -> ()ParentTraceContext#
pub struct ParentTraceContextValue-copied parent span context passed from the host into sync thunks and async fibers.
Field hasParent#
pub hasParent: boolField traceHigh#
pub traceHigh: u64Field traceLow#
pub traceLow: u64Field span#
pub span: u64Field flags#
pub flags: u8Implementation Copy for ParentTraceContext#
impl Copy for ParentTraceContextTraceRuntime#
pub struct TraceRuntimeStatic runtime helpers for installing HostTracer and propagating parent span contexts.
Implementation TraceRuntime#
impl TraceRuntimeAssociated function setEntry#
pub fn setEntry(
hasParent: u32,
traceHigh: u64,
traceLow: u64,
span: u64,
flags: u32,
) -> ()Stores the incoming host parent trace context for the immediately following export call.
Associated function captureEntry#
pub fn captureEntry() -> ParentTraceContextReads the entry parent trace context by value (for capturing into async task structs).
Associated function current#
pub fn current(outPtr: *mut u64) -> u32Writes the currently active Silk TraceContext into outPtr ([traceHigh, traceLow,
span, flags]) and returns 1, or returns 0 when no span is active.
Associated function withParent#
pub effect fn withParent<'env, A, E, ?R>(
parent: ParentTraceContext,
body: once Effect<'env; A ! E ? R>,
) -> A ! E ? RRuns body under HostTracer with parent installed as the ambient parent context.
Associated function withEntry#
pub effect fn withEntry<'env, A, E, ?R>(
body: once Effect<'env; A ! E ? R>,
) -> A ! E ? RRuns body under HostTracer using the entry parent context set by the host.
Associated function shutdown#
pub fn shutdown() -> ()Releases the singleton HostTracer cell on silk_wb_shutdown.
Category: WebAssembly.
Profiles: wasm32-unknown-unknown, wasm64-unknown-unknown.