metrics-aws-billing

1.0.2 • Public • Published

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 period
  • aws 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 period
  • aws billing product estimated monthly total - rolling 30 day estimate of the total cost

image

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

Readme

Keywords

Package Sidebar

Install

npm i metrics-aws-billing

Weekly Downloads

4

Version

1.0.2

License

none

Last publish

Collaborators

  • segmentio
  • ivolo