{"repo":"prometheus/client_js","free":true,"listed":false,"github":"https://github.com/prometheus/client_js","clone":"git clone https://github.com/prometheus/client_js.git","description":"Prometheus client for node.js","language":"JavaScript","stars":3482,"topics":["metrics","prometheus-client","monitoring","nodejs"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"Prometheus client for node.js A prometheus client for Node.js that supports histogram, summaries, gauges and counters. Installation This package was previously published as prom-client . See the CHANGELOG for the breaking changes involved in upgrading. Usage See example folder for a sample usage. The library does not bundle any web framework. To expose the metrics, respond to Prometheus's scrape requests with the result of await registry.metrics() . Usage with Node.js's cluster or Worker module Note: the Prometheus client now also supports worker threads, with much the same constraints as cluster workers. See example/worker.js . Node.js's cluster module spawns multiple processes and hands off socket connections to those workers. Returning metrics from a worker's local registry will only reveal that individual worker's metrics, which is generally undesirable. To solve this, you can aggregate all of the workers' metrics in the master process. See example/cluster.js for an example. Instantiate ClusterRegistry before branching on cluster.isPrimary , as shown in the example. Its constructor installs the appropriate IPC listener in each process; if only the primary creates it, workers cannot answer aggregation requests and clusterMetrics() times out. Default metrics use sensible aggregation methods. (Note, however, that the event loop lag mean and percentiles are averaged, which is not perfectly accurate.) Custom metrics are summed across workers by default. To use a different aggr","default_branch":null,"files":null,"tree":[],"storefront":"/r/prometheus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/prometheus/client_js/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}