prometheus-client-js

2.3.6 • Public • Published

Build Status npm David David

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 instrumentation metrics library for Node.JS. Metrics are intended to be scraped by a Prometheus server.

NPM Stats

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:

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:

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)

/prometheus-client-js/

    Package Sidebar

    Install

    npm i prometheus-client-js

    Weekly Downloads

    208

    Version

    2.3.6

    License

    MIT

    Last publish

    Collaborators

    • ekristen