SupervisionEvent Type
One typed transition of a live supervision, delivered by `SupervisionSession.EventsAsync` — the stream counterpart of the `OnRestart`/`OnStormPause` callbacks and the `Status` snapshot, which it adds to rather than replaces. Read `Kind` first: it says which transition this is, and therefore which of the payload properties below carry a value (each is `None` for every other kind). `Name` is the same fact as a stable lowercase machine identifier — `incarnation_started`, `restart_scheduled`, … — suitable as a log field or metric label, in the same `snake_case` style as the `"kind"` identifiers `ReportJson` writes. **Non-secret by construction.** An event carries lifecycle facts only: counters, a pid, an `Outcome`, durations, the program name, and coarse failure/stop classifications. It never carries argv, environment values, captured stdout/stderr, or a `ProcessError`'s message — the same taxonomy `MemberInfo` and the library's logging already follow, so a consumer can forward the whole stream to a log or metrics sink without auditing it for secrets. Sealed with an internal constructor so it can gain fields without breaking the frozen API.
Instance members
| Instance member |
Description
|
Full Usage:
this.Attempt
Returns: int option
|
The 1-based incarnation number this event is about (`IncarnationStarted`, `IncarnationFinished`, `IncarnationFailed`, `HealthCheckFailed`, `GaveUp`); `None` otherwise. The first incarnation is `1`, so it is one ahead of `SupervisionOutcome.Restarts`.
|
|
Why the restart is happening, on `RestartScheduled` (`RestartCause.Exit` or `RestartCause.Liveness`); `None` otherwise. The same value the `OnRestart` callback receives.
|
|
The delay about to be slept out — the jittered backoff on `RestartScheduled`, the jittered pause on `StormPaused`; `None` otherwise.
|
Full Usage:
this.DroppedEvents
Returns: int64 option
|
How many events were dropped in this gap, on `EventsDropped`; `None` otherwise. The running lifetime total is `SupervisionSession.DroppedEventCount`.
|
|
How long the incarnation ran, on `IncarnationFinished`; `None` otherwise.
|
Full Usage:
this.FailureKind
Returns: string option
|
The failure's stable coarse class (`spawn`, `not_found`, `io`, …) on `IncarnationFailed` and `SupervisionFailed`; `None` otherwise. Intentionally a classification rather than the error itself — see the secret-safety note on this type.
|
Full Usage:
this.IsSuccess
Returns: bool option
|
Whether the finished incarnation counts as a success under the command's `OkCodes`, on `IncarnationFinished`; `None` otherwise. A `false` here is what the `RestartPolicy` reads as a crash.
|
Full Usage:
this.IsTerminal
Returns: bool option
|
On `HealthCheckFailed`: `true` when the probe failed fatally and supervision is ending, `false` when the unhealthy streak tripped and the ordinary restart path takes over. `None` on every other kind.
|
|
Which transition this event reports — the discriminator every consumer branches on.
|
Full Usage:
this.Name
Returns: string
|
This event's stable machine identifier (`incarnation_started`, `restart_scheduled`, …): the same information as `Kind`, in the lowercase form a structured log or metric label wants. Derived from `Kind` through the one function that spells these names, so the two can never disagree, and published in `spec/identifiers.json` for readers in other languages. Existing identifiers are never renamed; a new kind gets a new one.
|
|
How the incarnation ended, on `IncarnationFinished`; `None` otherwise.
|
Full Usage:
this.Pid
Returns: int option
|
The live child's OS process id on `IncarnationStarted`; `None` on every other kind, and also on an `IncarnationStarted` from a runner that exposes no live handle (a capture-only test double).
|
Full Usage:
this.Program
Returns: string
|
The supervised command's program name — on every event, so a stream merged across supervisors stays attributable.
|
|
Why supervision ended, on `Stopped`; `None` otherwise. The same `StopReason` the final `SupervisionOutcome` reports.
|
Full Usage:
this.Restart
Returns: int option
|
The 1-based lifetime restart number, on `RestartScheduled`; `None` otherwise. Matches `SupervisionOutcome.Restarts` once that restart becomes the last one.
|
Full Usage:
this.StormPause
Returns: int option
|
The 1-based lifetime storm-pause number, on `StormPaused`; `None` otherwise.
|
ProcessKit API Reference