#[non_exhaustive]pub struct Event {Show 15 fields
pub kind: String,
pub timestamp_ms: u64,
pub route: Option<String>,
pub consumer: Option<String>,
pub endpoint: Option<String>,
pub status: Option<u16>,
pub listener: Option<String>,
pub method: Option<String>,
pub duration_ms: Option<f64>,
pub attempts: Option<u32>,
pub rate_limited: bool,
pub broken: bool,
pub shed: bool,
pub edge_id: Option<String>,
pub attributes: Vec<(String, String)>,
}Expand description
A single analytics event.
Deliberately minimal and extensible: new fields are additive. kind
selects the event type (e.g. request); optional route/consumer
identifiers carry the common correlation keys, and attributes holds
everything else as string pairs to avoid a schema lock-in at M1. The
DW-043 request-completion fields (listener, method, duration,
outcomes) were added additively so the embedded store consumes this
type directly; attributes carries custom analytics dimensions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: StringEvent type discriminator, e.g. request.
timestamp_ms: u64Unix epoch milliseconds.
route: Option<String>Route name, when the event is tied to a matched route.
consumer: Option<String>Consumer name, when authenticated.
endpoint: Option<String>Upstream endpoint the request was forwarded to, if any.
status: Option<u16>Upstream response status code, if a response was produced.
listener: Option<String>Listener that accepted the request (DW-043).
method: Option<String>HTTP method (DW-043).
duration_ms: Option<f64>End-to-end request duration in milliseconds (DW-043).
attempts: Option<u32>Upstream attempts made (DW-043).
rate_limited: boolThe request was rejected by a rate limit (DW-043).
broken: boolThe request failed through an open breaker (DW-043).
shed: boolThe request was shed by admission control (DW-043).
edge_id: Option<String>The edge instance ID this event originated from (SCALE-07,
#186). None for single-process (OSS) deployments; set by
the controller’s EmbeddedCollector when forwarding federated
events from edges to the aggregate store.
attributes: Vec<(String, String)>Additional string key/value data (custom dimensions ride here).
Implementations§
Source§impl Event
impl Event
Sourcepub fn request_now() -> Self
pub fn request_now() -> Self
Build a request event stamped with the current time.
Trait Implementations§
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§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