pub struct LogsBuilder {Show 19 fields
id: UInt32Builder,
time: TimestampNanosecondBuilder,
observed: TimestampNanosecondBuilder,
sev_num: Int32Builder,
sev_text: DictColumn,
event_name: DictColumn,
body: StringBuilder,
body_ser: BinaryBuilder,
trace_id: FixedSizeBinaryBuilder,
span_id: FixedSizeBinaryBuilder,
flags: UInt32Builder,
dropped: UInt32Builder,
resource_id: UInt16Builder,
scope_id: UInt16Builder,
log_attrs: AttrsBuilder,
rs: ResourceScope,
next_id: u32,
min_ts: i64,
max_ts: i64,
}Fields§
§id: UInt32Builder§time: TimestampNanosecondBuilder§observed: TimestampNanosecondBuilder§sev_num: Int32Builder§sev_text: DictColumnTwenty-four distinct values in practice, unbounded from a hostile client, so it is counted like any other dictionary.
event_name: DictColumnSet only on OTel Events, and enumerable by definition — an event name names a schema, so a producer minting a new one per record is already wrong.
body: StringBuilder§body_ser: BinaryBuilder§trace_id: FixedSizeBinaryBuilder§span_id: FixedSizeBinaryBuilder§flags: UInt32Builder§dropped: UInt32Builder§resource_id: UInt16Builder§scope_id: UInt16Builder§log_attrs: AttrsBuilder§rs: ResourceScope§next_id: u32§min_ts: i64§max_ts: i64Implementations§
Source§impl LogsBuilder
impl LogsBuilder
pub fn new() -> Self
pub fn num_rows(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn approx_bytes(&self) -> usize
pub fn approx_bytes(&self) -> usize
Rough resident cost of the accumulated builders. Used by the flusher to decide when to seal, so that block size is bounded by bytes rather than by row count (rows vary by three orders of magnitude in width).
The variable-width heaps are measured rather than estimated. Counting only fixed-width columns makes a 32 KB log body weigh the same as a 20-byte one, which is how a 32 MB target seals a multi-gigabyte block on a GenAI workload — and resident footprint is one of the four axes.
Sourcepub fn has_headroom_for(&self, req: &ExportLogsServiceRequest) -> bool
pub fn has_headroom_for(&self, req: &ExportLogsServiceRequest) -> bool
Whether req is guaranteed to fit without overflowing a UInt16
dictionary or id space.
Deliberately conservative — it assumes every key in the request is new — because the alternative is discovering the overflow halfway through an append, and an Arrow builder cannot be rolled back. The flusher seals when this returns false and puts the request in the next block, so overflow costs a slightly small block and never costs the caller their data.
Sourcepub fn append_request(
&mut self,
req: &ExportLogsServiceRequest,
) -> Result<usize>
pub fn append_request( &mut self, req: &ExportLogsServiceRequest, ) -> Result<usize>
Absorb one OTLP export request. Returns the number of log records added.
Sourcepub fn finish(&mut self) -> Result<Sealed>
pub fn finish(&mut self) -> Result<Sealed>
Seal the accumulated rows into a block and reset for the next one.
The reset happens on the error path too. seal calls finish on each
column builder as it goes, so a failure part way through leaves this one
holding columns of unequal length; reusing it would make every subsequent
seal fail identically and the node would reject exports until restarted.
fn seal(&self, sidecars: Sidecars) -> Result<Sealed>
Trait Implementations§
Source§impl Default for LogsBuilder
impl Default for LogsBuilder
Source§impl SignalBuilder for LogsBuilder
impl SignalBuilder for LogsBuilder
Source§const SIGNAL: &'static str = "logs"
const SIGNAL: &'static str = "logs"
Source§type Request = ExportLogsServiceRequest
type Request = ExportLogsServiceRequest
Source§fn has_headroom_for(&self, req: &Self::Request) -> bool
fn has_headroom_for(&self, req: &Self::Request) -> bool
Source§fn append_request(&mut self, req: &Self::Request) -> Result<usize>
fn append_request(&mut self, req: &Self::Request) -> Result<usize>
Source§fn approx_bytes(&self) -> usize
fn approx_bytes(&self) -> usize
fn is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for LogsBuilder
impl RefUnwindSafe for LogsBuilder
impl Send for LogsBuilder
impl Sync for LogsBuilder
impl Unpin for LogsBuilder
impl UnsafeUnpin for LogsBuilder
impl UnwindSafe for LogsBuilder
Blanket Implementations§
impl<T> Allocation 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
§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].