Async Node.JS Prometheus Client
This library was built to allow for asynchronous metric tracking. This mostly just means that it was built in order to use Redis as a registry.
The specific use case this was created for, was tracking metrics on Zeit.co's Now v2 platform, without using a PushGateway.
How does it work?
Normally, NodeJS process are long running, and share memory. With the advent of serverless frameworks and technologies, NodeJS apps are starting to scale across multiple processes and "servers". This can be problematic for metric tracking and Prometheus, as you need to set it up to scrape a particular endpoint. You might not always know what the direct endpoint is!
Some might suggest using a PushGateway, but this comes with its own list of problems to solve.
This solution was heavily inspired (pretty much a clone) from the PHP library.
Usage
Create your registry:
; // By default, this will use an In Memory registry;// Or, a Redis one!;
Create some metrics
;await counter.inc'blue';await counter.incBy3, 'green'; await gauge.set25, ;await gauge.inc; histogram.observe35, ;
Expose the metrics
; app.get'/metrics',