Skip to main content

EventKind

Enum EventKind 

Source
#[non_exhaustive]
pub enum EventKind {
Show 21 variants SubscriberPanicked, RuntimeFailure, SubscriberOverflow, ShutdownRequested, AllStoppedWithinGrace, GraceExceeded, AttemptStarting, AttemptSucceeded, AttemptCanceled, AttemptFailed, AttemptTimedOut, BackoffScheduled, TaskAddRequested, TaskAdded, TaskAddFailed, TaskRemoveRequested, TaskRemoved, TaskFinished, ControllerRejected, ControllerSubmitted, ControllerSlotTransition,
}
Expand description

Describes what happened in the runtime.

Every event has seq, at, and kind. Variant docs list only the additional fields normally set by the runtime. Include a wildcard arm when matching because new event kinds may be added.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SubscriberPanicked

A subscriber panicked while processing an event.

Sets:

  • task: subscriber name
  • reason: panic info/message
  • at: wall-clock timestamp
  • seq: process-local sequence
§

RuntimeFailure

An internal runtime component failed.

This includes a caught panic or a worker that did not join cleanly.

Sets:

  • task: runtime component name
  • reason: diagnostic failure details
  • at: wall-clock timestamp
  • seq: process-local sequence
§

SubscriberOverflow

An event was lost because a subscriber path fell behind or closed.

Sets:

  • task: subscriber name (or the internal consumer that lagged)
  • reason: "full", "closed", or "lagged(n)"
  • at: wall-clock timestamp
  • seq: process-local sequence
§

ShutdownRequested

Shutdown was requested.

This can come from an OS signal or an explicit runtime shutdown request.

Sets:

  • at: wall-clock timestamp
  • seq: process-local sequence
§

AllStoppedWithinGrace

All tasks stopped within configured grace period.

Sets:

  • at: wall-clock timestamp
  • seq: process-local sequence
§

GraceExceeded

Grace period exceeded; some tasks did not stop in time.

Sets:

  • at: wall-clock timestamp
  • seq: process-local sequence
§

AttemptStarting

A task attempt is starting.

Sets:

  • id: task run identity
  • task: task name
  • attempt: attempt number (1-based for this task run)
  • at: wall-clock timestamp
  • seq: process-local sequence
§

AttemptSucceeded

A task attempt returned Ok(()).

This is an attempt result, not always the final task result. Under RestartPolicy::Always, another attempt follows.

Sets:

  • id: task run identity
  • task: task name
  • attempt: attempt number
  • duration_ms: attempt duration
§

AttemptCanceled

Task attempt returned TaskError::Canceled.

Sets:

  • id: task run identity
  • task: task name
  • attempt: attempt number
  • duration_ms: attempt duration
§

AttemptFailed

A task attempt returned a failure.

This includes retryable failures, fatal errors, task-returned timeouts, and panics caught while running user code. A configured per-attempt deadline instead emits AttemptTimedOut. A later event shows whether Taskvisor retries or reaches a terminal state.

Sets:

  • id: task run identity
  • task: task name
  • attempt: attempt number
  • duration_ms: attempt duration
  • reason: error message
  • exit_code: process-like exit code, when available
§

AttemptTimedOut

Task exceeded its configured timeout for this attempt.

Sets:

  • id: task run identity
  • task: task name
  • attempt: attempt number
  • timeout_ms: configured timeout
  • duration_ms: elapsed attempt duration
§

BackoffScheduled

The next attempt was scheduled after success or failure.

Sets:

  • id: task run identity
  • task: task name
  • attempt: previous attempt number
  • delay_ms: delay before the next attempt (ms)
  • backoff_source: Success or Failure
  • reason: last failure message (only for failure-driven backoff)
  • at: wall-clock timestamp
  • seq: process-local sequence
§

TaskAddRequested

An add request was published before Taskvisor processed it.

This does not confirm admission. For an all-or-nothing batch, Taskvisor publishes one request event per item before it sends the whole batch command.

Sets:

  • id: task run identity (pre-allocated for this add request)
  • task: logical task name
  • at: wall-clock timestamp
  • seq: process-local sequence
§

TaskAdded

A task was registered and its managed runner was spawned.

Sets:

  • id: task run identity
  • task: task name
  • at: wall-clock timestamp
  • seq: process-local sequence
§

TaskAddFailed

A task was not added because its name conflicted or its all-or-nothing batch was rejected.

No task runner is spawned for a rejected dynamic add. If an all-or-nothing batch is rejected, no task runner is spawned for any item.

Sets:

§

TaskRemoveRequested

A remove request was published before Taskvisor completed it.

This is not proof of removal. Use the management method’s result or a waiter when you need a reliable answer.

Sets:

  • id: task run identity
  • task: task name, when known
  • reason: optional removal reason
  • at: wall-clock timestamp
  • seq: process-local sequence
§

TaskRemoved

Task was removed from the supervisor after terminal cleanup.

Sets:

  • id: task run identity
  • task: task name
  • at: wall-clock timestamp
  • seq: process-local sequence
§

TaskFinished

A registered task reached its final outcome and will not start another attempt.

This is emitted once after the task runner is joined and before TaskRemoved. It also covers force-abort and an internal runner panic, even when no attempt-level terminal event exists.

Sets:

  • id: task run identity
  • task: task name
  • outcome_kind: stable machine-readable final category
  • reason: optional diagnostic detail; never parse it as schema
  • exit_code: process-like exit code, when available
  • at: wall-clock timestamp
  • seq: process-local sequence
§

ControllerRejected

Available on crate feature controller only.

The controller rejected a submission.

Sets:

  • task: slot name, when known
  • id: the rejected submission’s TaskId
  • outcome_kind: TaskOutcomeKind::Rejected
  • rejection_kind: stable machine-readable rejection category
  • reason: readable rejection details
§

ControllerSubmitted

Available on crate feature controller only.

The controller accepted a submission.

The task may still be queued or waiting for runtime registration. This event does not mean that the task body has started.

Sets:

  • task: slot name
  • id: the submission’s TaskId
  • reason: a readable admission summary, e.g. admission=Queue status=admitting or started_from_queue depth=N (exact text is diagnostic, not a stable contract)
§

ControllerSlotTransition

Available on crate feature controller only.

A controller slot changed state.

Sets:

  • task: slot name
  • reason: readable transition text; it is not a stable machine contract

Implementations§

Source§

impl EventKind

Source

pub fn as_label(&self) -> &'static str

Returns a stable machine-readable label for logs and metrics.

The label is the snake_case form of the variant name. Use it as an event name in tracing or as a metrics label value.

EventKind::AttemptStarting
          │ as_label()
          ▼
    "attempt_starting"
       ├── log field:    event="attempt_starting"
       └── metric label: event="attempt_starting"
use taskvisor::EventKind;

assert_eq!(EventKind::AttemptStarting.as_label(), "attempt_starting");
assert_eq!(EventKind::BackoffScheduled.as_label(), "backoff_scheduled");

Trait Implementations§

Source§

impl Clone for EventKind

Source§

fn clone(&self) -> EventKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EventKind

Source§

impl Debug for EventKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for EventKind

Source§

impl PartialEq for EventKind

Source§

fn eq(&self, other: &EventKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EventKind

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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