silk.trace.sink.

Destinations for recorder batches. Export runs in the caller's effect.

Import as Sink with import silk.trace.sink { Sink }.

Public declarations: 7.

Memory#

silk
pub type Memory = Records.Memory

An in-memory destination that retains copies of finished observations.

Sink#

silk
pub interface Sink<E, ?R>

Receives one borrowed signal batch. A successful result is the count rejected by the destination.

Operation send#

silk
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! E ? R

Consumes the borrowed batch and returns how many observations the destination rejected.

Implementation Sink<OutOfMemoryError ? &mut Allocator> for Memory#

silk
impl Sink<OutOfMemoryError ? &mut Allocator> for Memory

Operation send#

silk
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! OutOfMemoryError ? &mut Allocator

Console#

silk
pub struct Console

Writes a complete, newline-delimited OTLP JSON request to the active Writer for each batch.

Implementation Sink<WriterError ? &mut Writer> for Console#

silk
impl Sink<WriterError ? &mut Writer> for Console

Operation send#

silk
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! WriterError ? &mut Writer

OtlpResponseError#

silk
pub struct OtlpResponseError

A collector returned an unexpected response or exhausted the retry limit.

Field status#

silk
pub status: u16

The HTTP status received for the final attempt.

Implementation Debug for OtlpResponseError#

silk
impl Debug for OtlpResponseError

Operation debug#

silk
effect fn debug(self: &Self, formatter: &mut Formatter) -> () ! WriterError ? &mut Writer

Otlp#

silk
pub struct Otlp<'url>

An OTLP/HTTP destination. It posts JSON using the active Http client.

Implementation Otlp<'url>#

silk
impl<'url> Otlp<'url>

Associated function http#

silk
pub fn http(base: string<'url>) -> Otlp<'url>

Uses the collector base URL, including any path prefix, for all three signals.

Implementation Sink<OtlpResponseError | HttpError | OutOfMemoryError | WriterError ? &mut Allocator | &mut Http | &mut MonotonicClock> for Otlp<'url>#

silk
impl<'url> Sink<OtlpResponseError | HttpError | OutOfMemoryError | WriterError ? &mut Allocator | &mut Http | &mut MonotonicClock> for Otlp<'url>

Operation send#

silk
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64
  ! OtlpResponseError | HttpError | OutOfMemoryError | WriterError ? &mut Allocator | &mut Http | &mut MonotonicClock

flush#

silk
pub effect fn flush<E, ?R, S: Sink<E ? R>>(recorder: &Recorder, sink: &mut S) -> ()
! E | OutOfMemoryError ? R | &mut Allocator

Drains at most one recorder capacity of completed spans and logs, then snapshots cumulative metrics. A full batch contains 32 records. A failed send charges the records it consumed to the drop counters.

exportBatches#

silk
pub effect fn exportBatches<E, ?R, S: Sink<E ? R>>(recorder: &Recorder, sink: &mut S) -> ()
! E | OutOfMemoryError ? R | &mut Allocator | &mut MonotonicClock

Flushes once a second until the caller cancels the exporter or the sink fails. Run it outside the recorder's ambient scope to keep its requests out of the exported trace.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page