pub trait TelemetrySink: Send + Sync {
// Required method
fn export(&self, span: &FilterSpan);
// Provided method
fn enabled(&self) -> bool { ... }
}Expand description
Where the host sends each FilterSpan. Deliberately sync (the OTel SDK’s
SpanExporter is async and would pull tokio — ADR 000009 keeps that named-deferred): a sink
must not block the data plane. NoopSink is the default; an OTLP-mapping sink is added when
network export lands.
Required Methods§
fn export(&self, span: &FilterSpan)
Provided Methods§
Sourcefn enabled(&self) -> bool
fn enabled(&self) -> bool
Whether this sink consumes spans at all. When false, the host skips span construction
entirely on the per-request path — build_filter_span allocates (name, attributes, one
event per host-log line), which would otherwise be paid per hook call just to be dropped
by export. Defaults to true; only a sink that discards everything should override.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".