#[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
SubscriberPanicked
A subscriber panicked while processing an event.
Sets:
task: subscriber namereason: panic info/messageat: wall-clock timestampseq: 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 namereason: diagnostic failure detailsat: wall-clock timestampseq: 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 timestampseq: process-local sequence
ShutdownRequested
Shutdown was requested.
This can come from an OS signal or an explicit runtime shutdown request.
Sets:
at: wall-clock timestampseq: process-local sequence
AllStoppedWithinGrace
All tasks stopped within configured grace period.
Sets:
at: wall-clock timestampseq: process-local sequence
GraceExceeded
Grace period exceeded; some tasks did not stop in time.
Sets:
at: wall-clock timestampseq: process-local sequence
AttemptStarting
A task attempt is starting.
Sets:
id: task run identitytask: task nameattempt: attempt number (1-based for this task run)at: wall-clock timestampseq: 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 identitytask: task nameattempt: attempt numberduration_ms: attempt duration
AttemptCanceled
Task attempt returned TaskError::Canceled.
Sets:
id: task run identitytask: task nameattempt: attempt numberduration_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 identitytask: task nameattempt: attempt numberduration_ms: attempt durationreason: error messageexit_code: process-like exit code, when available
AttemptTimedOut
Task exceeded its configured timeout for this attempt.
Sets:
id: task run identitytask: task nameattempt: attempt numbertimeout_ms: configured timeoutduration_ms: elapsed attempt duration
BackoffScheduled
The next attempt was scheduled after success or failure.
Sets:
id: task run identitytask: task nameattempt: previous attempt numberdelay_ms: delay before the next attempt (ms)backoff_source:SuccessorFailurereason: last failure message (only for failure-driven backoff)at: wall-clock timestampseq: 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 nameat: wall-clock timestampseq: process-local sequence
TaskAdded
A task was registered and its managed runner was spawned.
Sets:
id: task run identitytask: task nameat: wall-clock timestampseq: 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:
id: task run identity of the rejected add requesttask: task nameoutcome_kind:TaskOutcomeKind::Rejectedrejection_kind:RejectionKind::AlreadyExistsorRejectionKind::BatchRejectedreason: diagnostic rejection detailsat: wall-clock timestampseq: process-local sequence
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 identitytask: task name, when knownreason: optional removal reasonat: wall-clock timestampseq: process-local sequence
TaskRemoved
Task was removed from the supervisor after terminal cleanup.
Sets:
id: task run identitytask: task nameat: wall-clock timestampseq: 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 identitytask: task nameoutcome_kind: stable machine-readable final categoryreason: optional diagnostic detail; never parse it as schemaexit_code: process-like exit code, when availableat: wall-clock timestampseq: process-local sequence
ControllerRejected
controller only.The controller rejected a submission.
Sets:
task: slot name, when knownid: the rejected submission’sTaskIdoutcome_kind:TaskOutcomeKind::Rejectedrejection_kind: stable machine-readable rejection categoryreason: readable rejection details
ControllerSubmitted
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 nameid: the submission’sTaskIdreason: a readable admission summary, e.g.admission=Queue status=admittingorstarted_from_queue depth=N(exact text is diagnostic, not a stable contract)
ControllerSlotTransition
controller only.A controller slot changed state.
Sets:
task: slot namereason: readable transition text; it is not a stable machine contract
Implementations§
Source§impl EventKind
impl EventKind
Sourcepub fn as_label(&self) -> &'static str
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");