metrics-aws-billing
v1.0.2
Published
AWS billing plugin for segmentio/metrics
Downloads
32
Readme
metrics-aws-billing
An aws-billing plugin for segmentio/metrics.
Use this plugin to visualize your AWS hosting costs on a dashboard.
Installation
$ npm install metrics-aws-billing
Example
var Metrics = require('metrics');
var billing = require('metrics-aws-billing');
Metrics()
.every('1d', billing(accountId, key, secret, bucket, region));
Metrics
The metrics exposed by this plugin are:
aws billing total
- the total amount charged by AWS so far this billing periodaws billing estimated monthly total
- rolling 30 day estimate of the total cost
and for each product
, it will expose the following metric:
aws billing product total
- the total amount charged by AWS so far this billing periodaws billing product estimated monthly total
- rolling 30 day estimate of the total cost
Quickstart
Here's a full example of a Geckoboard dashboard showing your total AWS costs:
var Metrics = require('metrics');
var billing = require('metrics-aws-billing');
var geckoboard = require('geckoboard')('api-key');
new Metrics()
.every('1d', billing(accountId, key, secret, bucket, region))
.use(function (metrics) {
metrics.on('aws billing total', function (metric) {
geckoboard(widget).number(metric.latest());
});
});
License
MIT