Skip to main content

Rca

Struct Rca 

Source
pub(crate) struct Rca {
Show 14 fields title: String, from: i64, to: i64, summary: String, impact: Vec<String>, timeline: Vec<(i64, String)>, root_cause: String, pub(crate) evidence: Vec<Fact>, ruled_out: Vec<String>, contributing: Vec<String>, remediation: Vec<String>, verification: Vec<String>, prevention: Option<String>, pub(crate) emit: bool,
}
Expand description

A parsed, not-yet-verified write-up.

Nothing here is rendered until verified is true, which is the type-level half of the promise the module header makes.

Fields§

§title: String§from: i64§to: i64§summary: String§impact: Vec<String>§timeline: Vec<(i64, String)>

Sorted by time at parse, because a timeline given out of order is the one defect in this document that a reader will believe rather than notice.

§root_cause: String§evidence: Vec<Fact>§ruled_out: Vec<String>§contributing: Vec<String>§remediation: Vec<String>§verification: Vec<String>§prevention: Option<String>

An alerts.kyaml fragment, already through the rule parser.

§emit: bool

Implementations§

Source§

impl Rca

Source

pub(crate) fn verified(&self) -> bool

True once every citation has been re-run.

Source

pub(crate) fn dead(&self) -> Option<String>

The citations that came back empty or unreadable, as one message.

Returned instead of the document rather than alongside it. A markdown RCA is a thing people paste into a ticket, and handing one back with a warning above it is handing back a document that will be pasted without the warning.

Source

pub(crate) fn render(&self) -> String

The document.

§Panics

If a citation has not been re-run. Callers go through dead first, which is only meaningful after the same pass.

Source

pub(crate) fn export(&self, md: &str, now: i64) -> ExportLogsServiceRequest

The write-up as an OTLP log export, for emit.

A log record and not a new kind of object, which is the whole reason this is affordable: an RCA is then searchable by query_records, framed by correlate, and expired by the same retention as the telemetry it describes. There is no incident store, no index to maintain and no second thing to back up (principle 4).

Trait Implementations§

Source§

impl Debug for Rca

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Rca

§

impl RefUnwindSafe for Rca

§

impl Send for Rca

§

impl Sync for Rca

§

impl Unpin for Rca

§

impl UnsafeUnpin for Rca

§

impl UnwindSafe for Rca

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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

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