Skip to content
pegma-devPublic

About

Composable health probes and HTTP responses for Pegma hosts: process, injected Store pings, and safe diagnostics.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Health

CI License: MIT

Composable health probes and HTTP responses for Pegma hosts.

Important

Pegma is in early 0.x development. Packages are published, but no public API is stable.

Why it exists

Hosts need a boring public /health that proves the process is alive, optionally proves storage round-trips, emits a structured log line, and never leaks secrets. This package owns that contract; the host owns wiring and backends.

Constraint that shapes everything

Explicit checks at the composition root. No autodiscovery. No owned Store. Safe detail only.

Usage

import {
  createDetailCheck,
  createProcessCheck,
  createStorePingCheck,
  healthProbeCollection,
  runHealthChecks,
  toHealthResponse,
} from "@pegma/health";

const result = await runHealthChecks({
  service: "my-api",
  logger,
  checks: [
    createProcessCheck(),
    createDetailCheck("logging", { datadog: true }),
    createStorePingCheck({ store, collection: healthProbeCollection }),
  ],
});
const { status, body } = toHealthResponse(result);

Non-goals

  • Metrics, APM, or alert fan-out
  • Storage adapters
  • UI dashboards

Development

Requires Node.js 22 or 24.

corepack enable
pnpm install --frozen-lockfile
pnpm run format:check
pnpm run check
pnpm test

Maintainers should follow the release runbook. Releases publish only from protected signed tags through npm trusted publishing.

License

MIT

About

Composable health probes and HTTP responses for Pegma hosts: process, injected Store pings, and safe diagnostics.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages