Skip to main content

OperatorEvent

Enum OperatorEvent 

Source
pub enum OperatorEvent {
Show 16 variants ReplicationBroken { peer: String, reason: String, }, Divergence { peer: String, leader_lsn: u64, follower_lsn: u64, }, WalFsyncFailed { path: String, error: String, }, DiskSpaceCritical { path: String, available_bytes: u64, threshold_bytes: u64, }, AuthBypass { principal: String, resource: String, detail: String, }, AdminCapabilityGranted { granted_to: String, capability: String, granted_by: String, }, SecretRotationFailed { secret_ref: String, error: String, }, ConfigChanged { key: String, old_value: String, new_value: String, changed_by: String, }, StartupFailed { phase: String, error: String, }, ShutdownForced { reason: String, }, SchemaCorruption { collection: String, detail: String, }, CheckpointFailed { lsn: u64, error: String, }, DanglingAdminIntent { id: Uuid, op: IntentOp, started_at_ms: u64, last_phase: IntentPhase, }, ConfigChangeRequiresRestart { fields_changed: String, }, SubscriptionSchemaChange { collection: String, subscription_names: String, fields_added: String, fields_removed: String, lsn: u64, }, OutboxDlqActivated { queue: String, dlq: String, reason: String, },
}
Expand description

High-severity system conditions that require operator attention.

Every variant carries typed crate::runtime::audit_log::AuditValue fields so adversarial bytes (CRLF, NUL, quote, non-UTF-8) are escape-safe at the audit boundary (ADR 0010).

Variants§

§

ReplicationBroken

A replication stream to a follower/replica broke unexpectedly.

Fields

§peer: String
§reason: String
§

Divergence

Replication state diverged: the follower’s committed LSN or checksum disagrees with the leader.

Fields

§peer: String
§leader_lsn: u64
§follower_lsn: u64
§

WalFsyncFailed

The WAL fsync call failed. Data may be at risk on the current host.

Fields

§path: String
§error: String
§

DiskSpaceCritical

Available disk space fell below the configured critical threshold.

Fields

§path: String
§available_bytes: u64
§threshold_bytes: u64
§

AuthBypass

An authentication bypass was detected (e.g. auth gate returned allow for a request that should have been rejected).

Fields

§principal: String
§resource: String
§detail: String
§

AdminCapabilityGranted

An admin capability was granted to a principal at runtime.

Fields

§granted_to: String
§capability: String
§granted_by: String
§

SecretRotationFailed

Secret rotation failed; the current secret may be stale.

Fields

§secret_ref: String
§error: String
§

ConfigChanged

A runtime configuration change was applied to a live instance.

Fields

§old_value: String
§new_value: String
§changed_by: String
§

StartupFailed

The server process failed to start cleanly.

Fields

§phase: String
§error: String
§

ShutdownForced

The server process was forced to shut down (e.g. OOM killer, SIGKILL, unrecoverable error).

Fields

§reason: String
§

SchemaCorruption

On-disk schema metadata is corrupt or inconsistent.

Fields

§collection: String
§detail: String
§

CheckpointFailed

A scheduled or triggered checkpoint failed to complete.

Fields

§lsn: u64
§error: String
§

DanglingAdminIntent

An admin intent that was started but never reached a terminal phase (completed or aborted). Emitted by super::admin_intent_log::AdminIntentLog::scan_and_report at startup so operators can investigate interrupted operations.

Fields

§id: Uuid
§started_at_ms: u64

Unix milliseconds when the intent was started.

§last_phase: IntentPhase
§

ConfigChangeRequiresRestart

A config-file change was detected but one or more changed fields require a full server restart to take effect. The change was NOT applied; the operator must restart to pick it up.

Fields

§fields_changed: String
§

SubscriptionSchemaChange

An ALTER TABLE on a collection with active event subscriptions added or removed columns. Downstream consumers may see a different payload shape starting at lsn.

Fields

§collection: String
§subscription_names: String

Comma-separated subscription names affected.

§fields_added: String

Comma-separated columns added (empty string if none).

§fields_removed: String

Comma-separated columns removed (empty string if none).

§lsn: u64
§

OutboxDlqActivated

An event could not be delivered to its target queue after all retry attempts, and was routed to the dead-letter queue instead.

Fields

§queue: String
§reason: String

Implementations§

Source§

impl OperatorEvent

Source

pub fn all_variant_names() -> &'static [&'static str]

All variant names as CamelCase strings, in declaration order.

Source

pub fn emit_global(self)

Emit the event.

Execution order (per issue #202):

  1. Persist to audit — tamper-evident, durable.
  2. tracing::warn! breadcrumb — lands in red.log / stderr.
  3. eprintln! fallback — fires only if the audit write fails, ensuring the event is never silently lost.

Emit the event using the process-wide sink installed by the runtime at startup. When no sink is installed (early boot, tests without an audit logger), the tracing breadcrumb and eprintln fallback still fire so the event is never silently lost.

Source

pub fn emit(self, audit: &AuditLogger)

Trait Implementations§

Source§

impl Debug for OperatorEvent

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

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

impl<L> LayerExt<L> for L

Source§

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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