Hyperlinkv0.8.0-beta.28
DraftMigration checklist — 1/6
  • Current API — no legacy surface
  • LSP code previews
  • Clean example types
  • Verified examples
  • Follows the docs standards
  • Owner-reviewed

Fleet Health

Stadium-board health across a meshed pack of nodes — without letting a down neighbour take your local /health with it.

Per-node readiness (withReadinessGET /health / NodeStatus) stays local. FleetHealth is a separate glass on the same mesh Telemetry uses: leaf for this node, fleet fields that fold peers with Effect Exit kept so silence never lies.

Declare the glass

One tag. Distribute it across the droplets you actually run.

class DropletEast extends Node.Tag<DropletEast>()("app/DropletEast") {}
class DropletWest extends Node.Tag<DropletWest>()("app/DropletWest") {}

class MeshHealth extends FleetHealth.Tag<MeshHealth>()().pipe(
  Hyperlink.distributed([DropletEast, DropletWest]),
) {}

Serve with peers + optional readiness

Pass the same readiness rows /health uses when you want the leaf to match NodeStatus. Discharge the mesh with Hyperlink.peersLayer (or FleetHealth.alone for a single node).

const readiness = Effect.succeed([
  { key: "app/Cache", kind: "hyperlink-ts/Hyperlink", ready: true },
])

FleetHealth.serve(MeshHealth, { readiness }).pipe(
  Layer.provide(Hyperlink.peersLayer(MeshHealth, DropletEast)),
)

Read the board

FieldScopeMeaning
localleafThis nodes ok / degraded + resource rows
byNodefleetReachable (peers local) or Unreachable (Exit failure)
statusfleetok · degraded · partial (any unreachable)

Unreachableready: false. A cold cache is degraded; a dead peer is unreachable.

const glass = yield* MeshHealth

const local = yield* glass.local
// local: FleetHealth.LocalHealth — { status: "ok" | "degraded", resources: … }

const byNode = yield* glass.byNode
// byNode: Record<string, FleetHealth.NodeReport>
//   Reachable  → { _tag: "Reachable", status, resources }
//   Unreachable → { _tag: "Unreachable" }

const status = yield* glass.status
// status: "ok" | "degraded" | "partial"

Peers only expose the leaf (local). byNode / status are Hyperlink.fleet — excluded from fan-out so a fold cant re-aggregate an aggregate. When you need to keep every peer Exit yourself, use MultiNode.combineByNodeExit (FleetHealth does); combineByNode / Hyperlink.fleetHealth still skip-omit for metric-style folds.

What not to do

Do not fold peers inside withReadiness — that cascades one nodes failure into neighbours /health. Standards forbid it; FleetHealth exists so the fold is explicit and client-shaped.

Runnable form: pnpm run example:fleet-health-glass. See also Telemetry and Fleets & Peers.

Edit this page on GitHub