pub struct RecordBatchSink { /* private fields */ }Expand description
Buffers tracing events and produces Arrow RecordBatches.
Implements TraceEventSink for tracing events (spans, log events).
This type can be cloned to get a handle for flushing from outside the telemetry system. Clone it before registering with telemetry if you need to call flush() later.
Produces three tables:
spans: Information about span creation (NewSpan events)span_events: Enter/exit/close events for spansevents: Tracing events (e.g., tracing::info!())
For entity lifecycle events (actors, meshes), see EntityDispatcher.
Implementations§
Source§impl RecordBatchSink
impl RecordBatchSink
Sourcepub fn new(batch_size: usize, flush_callback: FlushCallback) -> Self
pub fn new(batch_size: usize, flush_callback: FlushCallback) -> Self
Create a new RecordBatchSink with the specified batch size and flush callback.
The callback receives (table_name, record_batch) when a batch is ready. The callback should handle empty batches by creating the table with the schema but not appending the empty data.
§Arguments
batch_size- Number of rows to buffer before flushing each tableflush_callback- Called with (table_name, record_batch) when a batch is ready
Sourcepub fn flush(&self) -> Result<()>
pub fn flush(&self) -> Result<()>
Flush all buffers, emitting batches for all tables.
This always emits batches for all three tables (spans, span_events, events), even if they are empty. The callback is expected to handle empty batches by creating the table with the correct schema but not appending empty data.
Sourcepub fn new_printing(batch_size: usize) -> Self
pub fn new_printing(batch_size: usize) -> Self
Create a new RecordBatchSink that prints batches to stdout.
Trait Implementations§
Source§impl Clone for RecordBatchSink
impl Clone for RecordBatchSink
Source§fn clone(&self) -> RecordBatchSink
fn clone(&self) -> RecordBatchSink
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl TraceEventSink for RecordBatchSink
impl TraceEventSink for RecordBatchSink
Source§fn consume(&mut self, event: &TraceEvent) -> Result<(), Error>
fn consume(&mut self, event: &TraceEvent) -> Result<(), Error>
Source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Source§fn target_filter(&self) -> Option<&Targets>
fn target_filter(&self) -> Option<&Targets>
Auto Trait Implementations§
impl Freeze for RecordBatchSink
impl RefUnwindSafe for RecordBatchSink
impl Send for RecordBatchSink
impl Sync for RecordBatchSink
impl Unpin for RecordBatchSink
impl UnwindSafe for RecordBatchSink
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].