0.3.1 • Published 7 years ago

prometheus-node-usage v0.3.1

Weekly downloads
29
License
MIT
Repository
github
Last release
7 years ago

prometheus-node-usage

Exporter node.js application metrics (CPU, RAM and uptime).

MIT License npm version Build Status Coverage Status david-dm dependency Status david-dm devDependency Status

Metrics from Grafana

Exports metrics from a Node application. The library obtains data on CPU and memory on current process and creates a format to be used from the Prometheus tool. Format example:

node_process_memory_used 4335264
node_process_memory_total 8368128
node_process_memory_rss 24854528
node_process_cpu_usage 12.5
node_process_uptime 0.256
node_process_disk_io_read 132
node_process_disk_io_write 12288

metrics node_process_disk_io_read and node_process_disk_io_write are available linux system only.

Installation

With npm or yarn installed, run :

$ npm install prometheus-node-usage
$ yarn add prometheus-node-usage

You can use prometheus-node-usage from your JavaScript project.

Usage

var metrics = require('prometheus-node-usage');

metrics.getMetricsAsync().then(function (metrics) {
    // use metrics in your soure code
});
import { getMetricsAsync } from "prometheus-node-usage";
const metrics = await getMetricsAsync();

License

The MIT License (MIT)

Copyright (c) 2017 Cyril Schumacher

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnishet to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago