# prometheus/client_js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/prometheus-client-js).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

3,500 stars · 433 forks · JavaScript · Apache-2.0

## Links

- GitHub: https://github.com/prometheus/client_js
- awesome-repositories: https://awesome-repositories.com/repository/prometheus-client-js.md

## Topics

`metrics` `monitoring` `nodejs` `prometheus-client`

## Description

This is a Prometheus client library for Node.js (published as prom-client). It lets an application define counters, gauges, histograms and summaries, attach labels to them, and expose the results in the Prometheus text or OpenMetrics format for a Prometheus server to scrape. It also ships type declarations, so editors can offer autocompletion and compile-time checks.

Beyond the basic metric types, it collects default process and runtime measurements, including event loop lag, garbage collection activity, and heap and system memory usage. It can merge metrics from cluster workers or worker threads into a single scrape result, with a configurable aggregation method per metric, and flush a stopping worker's latest values so they are not lost. Short-lived or batch jobs can push, replace or delete metrics on a Pushgateway. Exemplars carrying trace and span identifiers, along with a link to the OpenTelemetry API, let samples be correlated with distributed traces.

Metrics are held in registries. These can be the global one or custom ones, and they can be merged, reset, given default labels, or rebuilt from exported data. Custom metrics can refresh their values through a function that runs at scrape time. Histograms can generate linear or exponential buckets automatically, and summaries estimate quantiles with a streaming digest rather than storing every observation. Metrics can also be exported as plain objects or JSON, and the repository includes benchmark scripts for measuring instrumentation overhead.

## Tags

### System Administration & Monitoring

- [Prometheus Client Libraries](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-client-libraries.md) — Provides counters, gauges, histograms and summaries for instrumenting Node.js applications so a Prometheus server can scrape their metrics.
- [Prometheus Metrics Exporters](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/prometheus-metrics-exporters.md) — Instruments Node.js applications with counters, gauges, histograms and summaries that a Prometheus server can scrape over HTTP.
- [Default Runtime Metrics Collectors](https://awesome-repositories.com/f/system-administration-monitoring/default-runtime-metrics-collectors.md) — Gathers recommended process and runtime measurements such as event loop lag, active handles, garbage collection and version info on every scrape. ([source](https://github.com/prometheus/client_js#readme))
- [Metrics Text Renderers](https://awesome-repositories.com/f/system-administration-monitoring/metrics-text-renderers.md) — Renders all registered metrics as plain text in Prometheus or OpenMetrics format and supplies the matching content type for HTTP responses. ([source](https://github.com/prometheus/client_js/blob/main/index.d.ts))
- [Multi-Process Metric Aggregation](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/execution-tracing-analysis/execution-tracing/multi-process-metric-aggregation.md) — Combines measurements from cluster workers or worker threads into one scrape output so a multi-process service reports a single view.
- [Monotonic Counter Metrics](https://awesome-repositories.com/f/system-administration-monitoring/monotonic-counter-metrics.md) — Provides counters that only increase and reset on process restart, incremented per event so rates and totals can be scraped. ([source](https://github.com/prometheus/client_js/blob/main/README.md))
- [Node.js Runtime Metrics Collectors](https://awesome-repositories.com/f/system-administration-monitoring/node-js-runtime-metrics-collectors.md) — Collects default Node.js process and runtime measurements including event loop lag, heap and memory usage, active handles and garbage collection activity.
- [Custom Metric Definitions](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/custom-metric-scraping/custom-metric-definitions.md) — Lets applications define counters, gauges, histograms and summaries with names and help text, and refresh values through a collect function at scrape time. ([source](https://github.com/prometheus/client_js#readme))
- [Value Distribution Histograms](https://awesome-repositories.com/f/system-administration-monitoring/value-distribution-histograms.md) — Records observations into histograms with configurable buckets or summaries with sliding-window quantiles to analyse latency and size distributions. ([source](https://github.com/prometheus/client_js/blob/main/README.md))
- [Event Loop Lag Monitors](https://awesome-repositories.com/f/system-administration-monitoring/event-loop-lag-monitors.md) — Measures event loop lag and busy time to reveal responsiveness problems in the running application. ([source](https://github.com/prometheus/client_js/blob/main/lib/metrics))
- [Gauge Metric Tracking](https://awesome-repositories.com/f/system-administration-monitoring/gauge-metric-tracking.md) — Provides gauges whose value can be set, raised or lowered freely, such as memory use or queue size, with the latest reading exposed for scraping. ([source](https://github.com/prometheus/client_js/blob/main/README.md))
- [OpenMetrics Endpoints](https://awesome-repositories.com/f/system-administration-monitoring/health-monitoring-endpoints/openmetrics-endpoints.md) — Renders registered metrics in Prometheus text or OpenMetrics format with matching content types for HTTP response headers.
- [Heap Memory Monitoring](https://awesome-repositories.com/f/system-administration-monitoring/heap-memory-monitoring.md) — Reports total and used heap size, heap breakdowns by memory space and system memory so growth and pressure can be watched. ([source](https://github.com/prometheus/client_js/blob/main/lib/metrics))
- [Pull-Based Metric Scraping](https://awesome-repositories.com/f/system-administration-monitoring/logging-and-telemetry/metric-data-ingestion/pull-based-metric-scraping.md) — Renders current metric values on demand so a Prometheus server can pull them periodically over HTTP.
- [Metric Exemplar Correlations](https://awesome-repositories.com/f/system-administration-monitoring/metric-exemplar-correlations.md) — Attaches exemplars with trace and span identifiers to counter and histogram samples so OpenMetrics output links to distributed traces.
- [Metric Label Dimensions](https://awesome-repositories.com/f/system-administration-monitoring/metric-label-dimensions.md) — Lets users declare label names and attach values by object, chained call or position, including timers whose labels are completed after start. ([source](https://github.com/prometheus/client_js#readme))
- [Cluster Worker Metric Merging](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/server-metrics/metric-aggregators/cluster-worker-metric-merging.md) — Combines metrics from all cluster workers or worker threads into one scrape result with a configurable aggregation method per metric. ([source](https://github.com/prometheus/client_js/blob/main/README.md))
- [Multi-Process Metric Aggregators](https://awesome-repositories.com/f/system-administration-monitoring/multi-process-metric-aggregators.md) — Merges metrics from Node.js cluster workers and worker threads into one scrape result with a configurable aggregation method per metric.
- [Pushgateway Clients](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-client-libraries/pushgateway-clients.md) — Includes a client that pushes, replaces or deletes metrics on a Pushgateway so short-lived and batch jobs can still report data.
- [Metric Registries](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/metric-registries.md) — Registers metrics into the global registry or separate custom registries so groups of metrics can be organised and served together from one endpoint. ([source](https://github.com/prometheus/client_js#readme))
- [Push Gateways](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/prometheus-metrics-exporters/push-gateways.md) — Sends, overwrites or deletes metrics on a Pushgateway for short-lived jobs, with support for groupings, custom request options and gateways needing no job name. ([source](https://github.com/prometheus/client_js#readme))

### Programming Languages & Runtimes

- [Node.js Resource Monitoring](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-resource-monitoring.md) — Tracks event loop lag, heap and system memory, garbage collection and other process-level signals to catch resource problems early.

### Data & Databases

- [Streaming Quantile Summaries](https://awesome-repositories.com/f/data-databases/grouped-aggregations/quantile-digest-aggregators/streaming-quantile-summaries.md) — Estimates summary quantiles over a sliding window using a streaming digest, so distributions are reported without storing every observation. ([source](https://github.com/prometheus/client_js/blob/main/package.json))
