Skip to content

Overview & Quick Start

Prometheus & OpenMetrics Exporter

@nexload-sdk/healthcheck-prometheus

v2.1.0 Stable Released

Prometheus and OpenMetrics text serializers for @nexload-sdk/healthcheck reports.

Node.jsBun

@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.


import { createHealthManager } from "@nexload-sdk/healthcheck";
import { prometheusExporter } from "@nexload-sdk/healthcheck-prometheus";
const health = createHealthManager({ service: { name: "api" } });
const exporter = prometheusExporter({ prefix: "app" });
const report = await health.run("readiness");
const metricsText = exporter.export(report);
// Return Prometheus text in your HTTP endpoint
// Content-Type: text/plain; version=0.0.4; charset=utf-8

  • Lightweight Metric Formatting: Fast string serialization with zero dependencies on prom-client.
  • Status Gauges & Check Durations: Exports health_status, health_check_status, and health_check_duration_seconds.
  • Standard OpenMetrics Support: Fully compliant with Prometheus scrapers, VictoriaMetrics, and Grafana Agent.

Terminal window
pnpm add @nexload-sdk/healthcheck-prometheus @nexload-sdk/healthcheck

Requires Node.js >=20.9.0 or Bun >=1.0.0.