pub struct LogLine {
pub ts_ns: u64,
pub severity: LogSeverity,
pub service: String,
pub message: String,
pub labels: HashMap<String, String>,
pub numeric_fields: HashMap<String, f64>,
pub trace_id: Option<String>,
pub span_id: Option<String>,
}Expand description
One structured log line. labels is the low-cardinality map
(service, region, severity_str); fields carries typed
extra payload (latency_ms, status, bytes_out). Keeping them
separate lets the codec layer pick Dict for labels and
T64 / Delta for numeric fields.
Fields§
§ts_ns: u64§severity: LogSeverity§service: String§message: String§labels: HashMap<String, String>§numeric_fields: HashMap<String, f64>§trace_id: Option<String>Optional trace / span identifiers — wiring for graph-based span traversal comes later; the field lives here so the ingest pipe doesn’t need to reshape when that lands.
span_id: Option<String>Implementations§
Source§impl LogLine
impl LogLine
pub fn now( severity: LogSeverity, service: impl Into<String>, message: impl Into<String>, ) -> LogLine
pub fn with_label( self, key: impl Into<String>, value: impl Into<String>, ) -> LogLine
pub fn with_field(self, key: impl Into<String>, value: f64) -> LogLine
pub fn with_trace( self, trace_id: impl Into<String>, span_id: impl Into<String>, ) -> LogLine
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogLine
impl RefUnwindSafe for LogLine
impl Send for LogLine
impl Sync for LogLine
impl Unpin for LogLine
impl UnsafeUnpin for LogLine
impl UnwindSafe for LogLine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request