risingwave_common::util::tracing

Trait InstrumentStream

source
pub trait InstrumentStream
where Self: Stream + Sized,
{ // Required methods fn instrument(self, _: Span) -> Instrumented<Self>; fn instrument_with<S>(self, _: S) -> WithInstrumented<Self, S> where S: FnMut() -> Span; }
Expand description

Extension trait allowing [futures::Stream]s to be instrumented with a [tracing::Span].

Required Methods§

source

fn instrument(self, _: Span) -> Instrumented<Self>

Instruments the stream with the given span. Alias for tracing_futures::Instrument::instrument.

The span will be entered and exited every time the stream is polled. The span will be closed only when the stream is dropped.

If the stream is long-lived, consider InstrumentStream::instrument_with instead to avoid accumulating too many events in the span.

source

fn instrument_with<S>(self, _: S) -> WithInstrumented<Self, S>
where S: FnMut() -> Span,

Instruments the stream with spans created by the given closure every time an item is yielded.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> InstrumentStream for T
where T: Stream + Sized,