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#

silk
pub struct HostTracer

Ambient Tracer provider forwarding Silk spans live to the JavaScript/Effect host tracer.

Implementation Copy for HostTracer#

silk
impl Copy for HostTracer

Implementation Transferable for HostTracer#

silk
impl Transferable for HostTracer

Implementation Concurrent for HostTracer#

silk
impl Concurrent for HostTracer

Implementation Tracer for HostTracer#

silk
impl Tracer for HostTracer

Operation enter#

silk
effect fn enter<Args>(
      self: &Self,
      static name: string<'static>,
      static kind: SpanKind,
      static place: Place,
      args: &Args,
      remote: Option<SpanContext>,
    ) -> ()

Operation exit#

silk
effect fn exit(self: &Self) -> ()

Operation cancelled#

silk
effect fn cancelled(self: &Self) -> ()

Operation failed#

silk
effect fn failed(self: &Self, static error: string<'static>) -> ()

Operation attribute#

silk
effect fn attribute<V>(self: &Self, static key: string<'static>, value: &V) -> ()

Operation event#

silk
effect fn event<Args>(self: &Self, static name: string<'static>, args: &Args) -> ()

Operation recordError#

silk
effect fn recordError<V>(self: &Self, value: &V) -> ()
silk
effect fn link(self: &Self, context: &SpanContext) -> ()

ParentTraceContext#

silk
pub struct ParentTraceContext

Value-copied parent span context passed from the host into sync thunks and async fibers.

Field hasParent#

silk
pub hasParent: bool

Field traceHigh#

silk
pub traceHigh: u64

Field traceLow#

silk
pub traceLow: u64

Field span#

silk
pub span: u64

Field flags#

silk
pub flags: u8

Implementation Copy for ParentTraceContext#

silk
impl Copy for ParentTraceContext

TraceRuntime#

silk
pub struct TraceRuntime

Static runtime helpers for installing HostTracer and propagating parent span contexts.

Implementation TraceRuntime#

silk
impl TraceRuntime

Associated function setEntry#

silk
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#

silk
pub fn captureEntry() -> ParentTraceContext

Reads the entry parent trace context by value (for capturing into async task structs).

Associated function current#

silk
pub fn current(outPtr: *mut u64) -> u32

Writes 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#

silk
pub effect fn withParent<'env, A, E, ?R>(
      parent: ParentTraceContext,
      body: once Effect<'env; A ! E ? R>,
    ) -> A ! E ? R

Runs body under HostTracer with parent installed as the ambient parent context.

Associated function withEntry#

silk
pub effect fn withEntry<'env, A, E, ?R>(
      body: once Effect<'env; A ! E ? R>,
    ) -> A ! E ? R

Runs body under HostTracer using the entry parent context set by the host.

Associated function shutdown#

silk
pub fn shutdown() -> ()

Releases the singleton HostTracer cell on silk_wb_shutdown.

Category: WebAssembly.

Profiles: wasm32-unknown-unknown, wasm64-unknown-unknown.

View the source of this page