Overview & Quick Start
Prometheus & OpenMetrics Exporter
@nexload-sdk/healthcheck-prometheus
v2.1.0 Stable ReleasedPrometheus 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.
10-Second Code Snippet
Section titled “10-Second Code Snippet”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-8What You Get
Section titled “What You Get”- Lightweight Metric Formatting: Fast string serialization with zero dependencies on
prom-client. - Status Gauges & Check Durations: Exports
health_status,health_check_status, andhealth_check_duration_seconds. - Standard OpenMetrics Support: Fully compliant with Prometheus scrapers, VictoriaMetrics, and Grafana Agent.
Installation & Requirements
Section titled “Installation & Requirements”pnpm 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 exporter configuration options.