deriveHealth (lib/health.ts)

InsForge · packages/dashboard/src/features/compute/lib/health.ts · typescript · Apache-2.0
infra

Detects crash loops in container services by counting recent exit events.

// Source: https://github.com/InsForge/InsForge | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Derive a simple crash-loop signal from container lifecycle events.
//
// A healthy machine reports a single `start: started` after launch and stays
// quiet. A boot-looping container (e.g. Node throws on import → Fly restarts
// → throws → restarts) emits a steady cadence of `launch: pending` →
// `start: started` → `exit: stopped` triples roughly every 10s.
//
// The two drivers name the same moment differently: Fly reports `exit: stopped`,
// the Docker driver passes the daemon's own action through as `[container] die`.
// Matching only Fly's wording meant a restart-looping Docker 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key