Code Monkey home page Code Monkey logo

mackerel-plugin-aws-billing's Introduction

mackerel-plugin-aws-billing

Overview

mackerel-plugin-aws-billing is mackerel agent plugin that gets AWS cost and makes a graph.

Description

It uses AWS CloudWatch Api to get AWS Billing Data related to AWS Account.
It can make a graph on Service Metric.
It gets AWS cost every hour by using AWS API because unlike other metrics, AWS updates cost once in a few hours.
It writes cache file on server every hour, and uses cache to output data.

(β€»In order to output data to Service Metric, this plugin sends data to mackerel instead of mackerel-agent because mackerel-agent can not send data to Service Metric.)

Caution: You must must enable Billing Alerts.(see https://docs.aws.amazon.com/ja_jp/awsaccountbilling/latest/aboutv2/monitor-charges.html)

Usage

Send data to Host.

mackerel-plugin-aws-billing [-access-key-id=<id>] [-secret-access-key=<key>] [-target=<aws-services>] [-currency=<currency>]

Send data to Service Metric.

mackerel-plugin-aws-billing [-access-key-id=<id>] [-secret-access-key=<key>] [-target=<aws-services>] [-currency=<currency>] [-dest=<SerivceMetric or Host>] [-api-key=<api-key>] [-service-name=<servicename>]
  • access-key-id(required)*1
    access-key-id is published by AWS. It is required to use AWS API.

  • secret-access-key(required)*1
    secret-access-key is published by AWS. It is required to use AWS API..

  • target(optional)
    If target is not specified, this plugin gets all available services. If target is specified, this plugin gets specified available services. If you want to specify multiple services, separate with comma.(ex: target=AmazonEC2,AWSLambda) If you want to get sum of costs, give All to target.(ex: target=All)

    You can get cost of service that you use.

  • currency(optional)
    Defalut is in US Dollar.

  • dest(required)
    Use ServiceMetric or Host.

    If set ServiceMetric, This plugin outputs data to ServiceMetric. If set Host, This plugin outputs data to Host.

  • api-key(required)*2
    Required only if ServiceMetric is given to mode parameter. API Key is published by mackerel. You must give read and write premissions to API Key.

  • service-name(required)*2
    Required only if ServiceMetric is given to mode parameter. Specify mackerel service name to make graph on Service Metric page.

*1 You can set keys by environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY (see https://github.com/aws/aws-sdk-go#configuring-credentials)
*2 Required only if ServiceMetric is given to mode parameter.

Example of mackerel-agent.conf

[plugin.metrics.aws-billing]
command = "/path/to/mackerel-plugin-aws-billing/main" ... //arguments

mackerel-plugin-aws-billing's People

Contributors

littlekbt avatar

Watchers

James Cloos avatar  avatar

Forkers

ailispaw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.