# prometheus-client-js

> Prometheus Metrics Client implemented in Pure Node.JS

Latest version **2.3.6** (published 2016-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install prometheus-client-js
pnpm add prometheus-client-js
yarn add prometheus-client-js
bun add prometheus-client-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.6 |
| Published | 2016-02-26 |
| First published | 2015-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Erik Kristensen |
| Maintainers | ekristen |

## Links

- npm: https://www.npmjs.com/package/prometheus-client-js
- Repository: https://github.com/ekristen/prometheus-client
- Homepage: https://github.com/ekristen/prometheus-client#readme
- Issues: https://github.com/ekristen/prometheus-client/issues
- npm.io page: https://npm.io/package/prometheus-client-js

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [object-hash](https://npm.io/package/object-hash.md) ^1.1.2

## Recent versions

- 2.3.6 (latest) — 2016-02-26
- 4.0.0 (next) — 2016-07-21
- 3.0.1 — 2016-05-18
- 3.0.0 — 2016-05-17
- 2.3.5 — 2016-02-26
- 2.3.4 — 2016-02-26
- 2.3.3 — 2015-11-18
- 2.3.2 — 2015-11-18
- 2.3.1 — 2015-11-06
- 2.3.0 — 2015-10-30
- 2.2.0 — 2015-10-30
- 2.1.1 — 2015-10-29
- 2.1.0 — 2015-10-29
- 2.0.0 — 2015-10-29
- 1.1.2 — 2015-10-29
- … 3 more at https://npm.io/package/prometheus-client-js/versions

## README

[![Build Status](https://travis-ci.org/ekristen/prometheus-client.svg?branch=master)](https://travis-ci.org/ekristen/prometheus-client) [![npm](https://img.shields.io/npm/v/prometheus-client-js.svg)](https://www.npmjs.com/package/prometheus-client-js) [![David](https://img.shields.io/david/ekristen/prometheus-client.svg)](https://david-dm.org/ekristen/prometheus-client) [![David](https://img.shields.io/david/dev/ekristen/prometheus-client.svg)](https://david-dm.org/ekristen/prometheus-client#info=devDependencies&view=table)

# Prometheus Client (Pure Javascript)

**STATUS: WIP -- Mostly implemented minus the summary metric**

Originally based https://github.com/StreamMachine/prometheus_client_nodejs, but written without CoffeScript in just JavaScript. (Originally Licensed under Apache 2.0)

[Prometheus](http://prometheus.io) instrumentation metrics library for Node.JS. Metrics are intended to be scraped by a Prometheus server.

![NPM Stats](https://nodei.co/npm/prometheus-client-js.png?downloads=true&downloadRank=true&stars=true)

## Usage

### Getting Started

Install the `prometheus-client` package with NPM:

    npm install prometheus-client-js

Then require the package and set up a new client instance:

```javascript
var Prometheus = require('prometheus-client-js')
var client = new Prometheus()
```

The client library can create an HTTP app to serve up your metrics, or you
can point to the output function from your own app router.

To use the built-in server:

```javascript
client.createServer(9090)
```

Then use `curl http://127.0.0.1:9090` to see a text representation of your metrics.

By default, the Prometheus client will use a global namespace. That means that
any metrics registered inside your app (even by libraries) will show up in your
client without any need to pass around a client object.


## Metric Types

1. Counter (http://prometheus.io/docs/concepts/metric_types/#counter)
2. Gauge (http://prometheus.io/docs/concepts/metric_types/#gauge)
3. Histogram (http://prometheus.io/docs/concepts/metric_types/#histogram)
4. Summary (http://prometheus.io/docs/concepts/metric_types/#summary) (NOT YET IMPLEMENTED)

---
_Source: https://npm.io/package/prometheus-client-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
