Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- "node"
- "6"
- "4"
env:
- CXX=g++-4.8
addons:
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
![Apache 2](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat)
[![Homepage](https://img.shields.io/badge/homepage-Node%20Application%20Metrics-blue.svg)](https://developer.ibm.com/node/monitoring-post-mortem/application-metrics-node-js/) -->

<p align=center>
<a href='http://CloudNativeJS.io/'><img src='https://img.shields.io/badge/homepage-CloudNativeJS-blue.svg'></a>
<a href="https://travis-ci.org/RuntimeTools/appmetrics-dash.svg?branch=master"><img src="https://travis-ci.org/RuntimeTools/appmetrics-dash.svg?branch=master" alt="Build status"></a>
<a href='https://github.com/CloudNativeJS/ModuleLTS'><img src='https://img.shields.io/badge/Module%20LTS-Adopted-brightgreen.svg?style=flat' alt='Module LTS Adopted' /></a>
<a href='http://ibm.biz/node-support'><img src='https://img.shields.io/badge/Support-IBM%20Frameworks-brightgreen.svg?style=flat' alt='IBM Support' /></a>
</p>

appmetrics-prometheus provides a /metrics endpoint which is necessary for [Prometheus monitoring](https://prometheus.io/).

The data available on the /metrics endpoint is as follows:

* CPU
* os_cpu_used_ratio (Ratio of systems CPU currently in use, type: gauge)
* process_cpu_used_ratio (Ratio of process CPU currently in use, type: gauge)
Expand Down Expand Up @@ -96,6 +104,11 @@ Place the following code at the top of your applications server file.
require('appmetrics-prometheus').attach()
```

or to use preloading:
```sh
$ node --require appmetrics-prometheus/attach app.js
```

## prometheus = require('appmetrics-prometheus').attach()

This will launch the prometheus endpoint and start monitoring your application.
Expand Down Expand Up @@ -171,11 +184,22 @@ We gathered this information by monitoring the sample application [Acme Air][3].

We welcome contributions. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details about the contributor licence agreement and other information. If you want to do anything more involved than a bug fix or a minor enhancement then we would recommend discussing it in an issue first before doing the work to make sure that it's likely to be accepted. We're also keen to improve test coverage and may not accept new code unless there are accompanying tests.


## Module Long Term Support Policy

This module adopts the [Module Long Term Support (LTS)](https://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates:

| Module Version | Release Date | Minimum EOL | EOL With | Status |
|------------------|--------------|-------------|--------------|---------|
| V2.x.x | Jun 2018 | Dec 2019 | | Current |

## Version
1.0.1
2.0.0


## License

### License
The Node Application Metrics Prometheus is licensed using an Apache v2.0 License.
[Apache-2.0](LICENSE)


[1]:https://developer.ibm.com/open/node-application-metrics/
Expand Down
18 changes: 18 additions & 0 deletions attach.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*******************************************************************************
* Copyright 2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
// For preloading
'use strict';
require('./lib/appmetrics-prometheus.js').attach();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "appmetrics-prometheus",
"version": "1.0.1",
"version": "2.0.0",
"description": "Provides a Prometheus (/metrics) endpoint for Application Metrics",
"main": "index.js",
"dependencies": {
"appmetrics": "^3.0.1",
"appmetrics": "^4.0.0",
"debug": "^2.6.0",
"express": "^4.14.1"
},
Expand Down