Logo ProcessKit API Reference

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

this.Attempt

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`.

Returns: int option

this.Cause

Full Usage: this.Cause

Returns: RestartCause option

Why the restart is happening, on `RestartScheduled` (`RestartCause.Exit` or `RestartCause.Liveness`); `None` otherwise. The same value the `OnRestart` callback receives.

Returns: RestartCause option

this.Delay

Full Usage: this.Delay

Returns: TimeSpan option

The delay about to be slept out — the jittered backoff on `RestartScheduled`, the jittered pause on `StormPaused`; `None` otherwise.

Returns: TimeSpan option

this.DroppedEvents

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`.

Returns: int64 option

this.Duration

Full Usage: this.Duration

Returns: TimeSpan option

How long the incarnation ran, on `IncarnationFinished`; `None` otherwise.

Returns: TimeSpan option

this.FailureKind

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.

Returns: string option

this.IsSuccess

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.

Returns: bool option

this.IsTerminal

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.

Returns: bool option

this.Kind

Full Usage: this.Kind

Returns: SupervisionEventKind

Which transition this event reports — the discriminator every consumer branches on.

Returns: SupervisionEventKind

this.Name

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.

Returns: string

this.Outcome

Full Usage: this.Outcome

Returns: Outcome option

How the incarnation ended, on `IncarnationFinished`; `None` otherwise.

Returns: Outcome option

this.Pid

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).

Returns: int option

this.Program

Full Usage: this.Program

Returns: string

The supervised command's program name — on every event, so a stream merged across supervisors stays attributable.

Returns: string

this.Reason

Full Usage: this.Reason

Returns: StopReason option

Why supervision ended, on `Stopped`; `None` otherwise. The same `StopReason` the final `SupervisionOutcome` reports.

Returns: StopReason option

this.Restart

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.

Returns: int option

this.StormPause

Full Usage: this.StormPause

Returns: int option

The 1-based lifetime storm-pause number, on `StormPaused`; `None` otherwise.

Returns: int option

Type something to start searching.