pub struct SpanShipper { /* private fields */ }Expand description
Bounded queue + background task that batches server spans into OTLP-JSON POSTs.
Same discipline as crate::logship, for the same reason: this is fed from the response path of
every request. record is one non-blocking try_send and returns; a slow or absent collector
costs dropped spans, never request latency. Traces are telemetry, so the loss is bounded and
counted rather than buffered without limit — an unbounded buffer on a proxy turns a collector
outage into a proxy outage.
Implementations§
Source§impl SpanShipper
impl SpanShipper
pub fn stats(&self) -> &Arc<SpanShipStats> ⓘ
Sourcepub fn record(&self, span: ServerSpan)
pub fn record(&self, span: ServerSpan)
Hand a span to the shipper. Never blocks, never awaits, never fails the caller.
Trait Implementations§
Source§impl Clone for SpanShipper
impl Clone for SpanShipper
Source§fn clone(&self) -> SpanShipper
fn clone(&self) -> SpanShipper
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpanShipper
impl RefUnwindSafe for SpanShipper
impl Send for SpanShipper
impl Sync for SpanShipper
impl Unpin for SpanShipper
impl UnsafeUnpin for SpanShipper
impl UnwindSafe for SpanShipper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more