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#
pub type Memory = Records.MemoryAn in-memory destination that retains copies of finished observations.
Sink#
pub interface Sink<E, ?R>Receives one borrowed signal batch. A successful result is the count rejected by the destination.
Operation send#
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! E ? RConsumes the borrowed batch and returns how many observations the destination rejected.
Implementation Sink<OutOfMemoryError ? &mut Allocator> for Memory#
impl Sink<OutOfMemoryError ? &mut Allocator> for MemoryOperation send#
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! OutOfMemoryError ? &mut AllocatorConsole#
pub struct ConsoleWrites a complete, newline-delimited OTLP JSON request to the active Writer for each batch.
Implementation Sink<WriterError ? &mut Writer> for Console#
impl Sink<WriterError ? &mut Writer> for ConsoleOperation send#
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64 ! WriterError ? &mut WriterOtlpResponseError#
pub struct OtlpResponseErrorA collector returned an unexpected response or exhausted the retry limit.
Field status#
pub status: u16The HTTP status received for the final attempt.
Implementation Debug for OtlpResponseError#
impl Debug for OtlpResponseErrorOperation debug#
effect fn debug(self: &Self, formatter: &mut Formatter) -> () ! WriterError ? &mut WriterOtlp#
pub struct Otlp<'url>An OTLP/HTTP destination. It posts JSON using the active Http client.
Implementation Otlp<'url>#
impl<'url> Otlp<'url>Associated function http#
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>#
impl<'url> Sink<OtlpResponseError | HttpError | OutOfMemoryError | WriterError ? &mut Allocator | &mut Http | &mut MonotonicClock> for Otlp<'url>Operation send#
effect fn send(self: &mut Self, identity: &Resource, batch: &Batch<'_>) -> u64
! OtlpResponseError | HttpError | OutOfMemoryError | WriterError ? &mut Allocator | &mut Http | &mut MonotonicClockflush#
pub effect fn flush<E, ?R, S: Sink<E ? R>>(recorder: &Recorder, sink: &mut S) -> ()
! E | OutOfMemoryError ? R | &mut AllocatorDrains 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#
pub effect fn exportBatches<E, ?R, S: Sink<E ? R>>(recorder: &Recorder, sink: &mut S) -> ()
! E | OutOfMemoryError ? R | &mut Allocator | &mut MonotonicClockFlushes 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.