bare-prom-client
Reference overview for bare-prom-client: a Prometheus metrics client for Bare, API-compatible with the prom-client package.
bare-prom-client is a Prometheus metrics client for Bare, modelled on the popular prom-client package. It's pure JavaScript and bundles no web framework—you expose metrics by responding to Prometheus scrapes with await registry.metrics().
npm i bare-prom-clientAPI overview
Metrics register against a Registry (a default registry is provided). The four metric types are:
Counter— a value that only increases (requests served, errors seen).Gauge— a value that goes up and down (in-flight requests, queue depth).Histogram— sampled observations bucketed by configurable boundaries (request durations).Summary— observations summarized as configurable quantiles.
Each type takes a configuration object (name, help text, label names) and supports labelled series, zeroing, reset, and removal. Expose the registry's current values in Prometheus exposition format with await registry.metrics(); for Node-style cluster deployments, aggregate worker registries in the master process. See the repository README and its example/ directory for the full configuration and method surface.
See also
- Bare modules—the full
bare-*catalog. bare-http1—serve the metrics endpoint.- Bare runtime API—the runtime this runs on.