Overview & Quick Start
Prometheus & OpenMetrics Exporter
@nexload-sdk/healthcheck-prometheus
v3.0.1 ReleasedPrometheus and OpenMetrics text serializers for @nexload-sdk/healthcheck reports.
Examples follow workspace source. Check pending Changesets against your installed version.
SDK dependencies: @nexload-sdk/healthcheck
@nexload-sdk/healthcheck-prometheus serializes @nexload-sdk/healthcheck reports directly into Prometheus text exposition and OpenMetrics format without requiring bloated third-party metric client libraries.
10-Second Code Snippet
Section titled “10-Second Code Snippet”import { createHealthManager, runtimeInfoCheck } from "@nexload-sdk/healthcheck";import { toPrometheusText } from "@nexload-sdk/healthcheck-prometheus";
const health = createHealthManager({ service: { name: "api" }, checks: [runtimeInfoCheck()],});
const report = await health.run("all", { profile: "monitoring" });const body = toPrometheusText(report, { prefix: "shop_api" });
// Content-Type: text/plain; version=0.0.4; charset=utf-8What You Get
Section titled “What You Get”toPrometheusText(report, options?): Prometheus text format0.0.4, with no dependency onprom-client.toOpenMetricsText(report, options?): OpenMetrics1.0.0text, ending with# EOF.- Status and duration series: aggregate status, per-check status, per-check duration, run duration, and every collector metric in
report.metrics. - Label allowlist: only bounded labels are emitted (
service,scope,check,component,dependency,runtime,status,error_code,collector,version). Other labels are dropped.
Installation & Requirements
Section titled “Installation & Requirements”pnpm add @nexload-sdk/healthcheck-prometheus @nexload-sdk/healthchecknpm install @nexload-sdk/healthcheck-prometheus @nexload-sdk/healthcheckyarn add @nexload-sdk/healthcheck-prometheus @nexload-sdk/healthcheckbun add @nexload-sdk/healthcheck-prometheus @nexload-sdk/healthcheckRequires Node.js >=20.9.0 or Bun >=1.0.0.
Next Steps
Section titled “Next Steps”- Explore Production Guides & Scraping Setup for metric names, label conventions, and scraping routes.
- Check the API Reference & Signatures for
prefix,defaultLabelsandincludeDescriptions.