Skip to content

Healthcheck Node quick start

This page includes the manager setup. Read the Core quick start first if checks, collectors, or scopes are new to you.

import { createHealthManager, memoryCheck, shutdownCheck } from "@nexload-sdk/healthcheck";
import {
containerResourceCheck,
nodeRuntimeAdapter,
processMetricsCollector,
} from "@nexload-sdk/healthcheck-node";
export const health = createHealthManager({
service: { name: "api" },
runtime: nodeRuntimeAdapter(),
checks: [shutdownCheck(), memoryCheck(), containerResourceCheck()],
collectors: [processMetricsCollector()],
});
const report = await health.run("readiness");
console.log(report.status, report.runtime.name);
// ok node

This creates probes and report data, not an HTTP endpoint. If the result is not ok, inspect report.checks and use Troubleshooting.