Description
client_js is the Prometheus client library for Node.js that supports histograms, summaries, gauges and counters, so a Node.js service can record its own measurements and expose them to Prometheus. The library does not bundle a web framework. To expose metrics, your app responds to Prometheus scrape requests with the output of await registry.metrics(). A collectDefaultMetrics call adds the metrics Prometheus recommends, plus Node.js-specific ones such as event loop lag, active handles, garbage collection and the Node.js version. The README notes that some file descriptor and memory metrics are available only on Linux. The function accepts options for a metric name prefix, the target registry, custom garbage collection duration buckets, event loop monitoring precision and event loop utilization settings, and labels that apply to all default metrics, which helps in clustered environments. The package was previously published as prom-client, and the changelog lists breaking changes for upgraders. The project is open source on GitHub, with examples in its example folder.…
Highlights
- Counters, gauges, histograms and summaries
- Default Node.js metrics such as event loop lag and GC
- Custom registries, prefixes and labels
- No web framework required
- Open source on GitHub
Ratings & Reviews
No ratings yet
Be the first to rate Client JS.
People also visit
Influxdb Exporter
A server that accepts InfluxDB metrics via the HTTP API and exports them
Client JS FAQ
What is client_js?
The official Prometheus client library for Node.js, for recording metrics in a Node.js app and exposing them for scraping.
How do I expose the metrics?
Respond to Prometheus scrape requests with the result of await registry.metrics(). The library does not include a web server.
Which default metrics are included?
Recommended Prometheus metrics, plus Node.js ones such as event loop lag, active handles, garbage collection and the Node.js version.
Are all default metrics available everywhere?
No. The README says some file descriptor and memory metrics are only available on Linux.
Was it renamed?
Yes. The package was previously published as prom-client. The changelog lists the breaking changes for upgrading.
Is it free?
Yes. It is open source and the code is on GitHub.
What are the best Client JS alternatives?
Popular alternatives to Client JS include Promster, Nextcloud Exporter and Prometheus.ex. See all Client JS alternatives


