Skip to main content

LogsBuilder

Struct LogsBuilder 

Source
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: DictColumn

Twenty-four distinct values in practice, unbounded from a hostile client, so it is counted like any other dictionary.

§event_name: DictColumn

Set 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: i64

Implementations§

Source§

impl LogsBuilder

Source

pub fn new() -> Self

Source

pub fn num_rows(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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.

Source

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.

Source

pub fn append_request( &mut self, req: &ExportLogsServiceRequest, ) -> Result<usize>

Absorb one OTLP export request. Returns the number of log records added.

Source

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.

Source

fn seal(&self, sidecars: Sidecars) -> Result<Sealed>

Trait Implementations§

Source§

impl Default for LogsBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl SignalBuilder for LogsBuilder

Source§

const SIGNAL: &'static str = "logs"

Directory component under the data dir. Also the block name prefix, so changing it is an on-disk format change.
Source§

type Request = ExportLogsServiceRequest

The decoded OTLP export request this signal accepts.
Source§

fn has_headroom_for(&self, req: &Self::Request) -> bool

Whether req is guaranteed to fit without overflowing a UInt16 dictionary or id space. Read more
Source§

fn append_request(&mut self, req: &Self::Request) -> Result<usize>

Absorb one export request, returning the number of root-table rows added.
Source§

fn approx_bytes(&self) -> usize

Rough resident cost, with variable-width heaps measured rather than estimated from row counts — a 32 KB GenAI prompt must not weigh the same as a 20-byte one.
Source§

fn is_empty(&self) -> bool

Source§

fn finish(&mut self) -> Result<Sealed>

Seal and reset. After this returns, self is a fresh builder — including on the error path, where the caller has no way to know how far through the column-by-column finish it got.
Source§

fn snapshot(&self) -> Result<Sealed>

Materialise the rows accumulated so far without resetting, for Open. Sidecar-free; see Sealed::with. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more