Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ekristen/memory-prometheus-metrics

Uses memwatch-next to provide memory metrics to a Prometheus server
https://github.com/ekristen/memory-prometheus-metrics

Last synced: 1 day ago
JSON representation

Uses memwatch-next to provide memory metrics to a Prometheus server

Awesome Lists containing this project

README

        

# memory-prometheus-metrics

Uses `memwatch-next` to monitor the instrumented node.js process and exposes the metrics using https://github.com/ekristen/prometheus-client-js

## Usage

### Option 1

Provide an existing Prometheus client.

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

var client = new Prometheus()

var MemoryMetrics = require('memory-prometheus-metrics')

memoryMetrics(client)

client.createServer().listen()
```

### Option 2

Have `memory-prometheus-metrics` instantiate its own Prometheus client.

```javascript
var MemoryMetrics = require('memory-prometheus-metrics')

var metrics = MemoryMetrics()

metrics.client.createServer.listen()
```