项目作者: dnavarrom

项目描述 :
Grafana Backend for AWS Cost Explorer
高级语言: JavaScript
项目地址: git://github.com/dnavarrom/grafana-aws-cost-explorer-backend.git
创建时间: 2019-05-18T22:26:40Z
项目社区:https://github.com/dnavarrom/grafana-aws-cost-explorer-backend

开源协议:MIT License

下载


grafana-aws-cost-explorer-backend

Grafana Backend for AWS Cost Explorer using AWS Cost Explorer Library

Features:

  • Cost Explorer API Query Cache to reduce costs
  • YTD (Year to Date costs)
  • MTD (Month to Date costs)
  • Last Month costs
  • Today Costs

Backend Configuration

Config File

Details for AWS configuration here

  1. Git clone https://github.com/dnavarrom/grafana-aws-cost-explorer-backend
  2. cd grafana-aws-cost-explorer-backend
  3. nano ./config/default.js
  4. # Edit the following AWS variables
  5. accessKeyId: <Your AWS Key>
  6. secretAccessKey: <Your AWS Secret Key>
  7. # Edit backend Security Settings
  8. enabled : "false" <default false (disabled)>
  9. secret : "thepassword"
  10. # Optional cache settings
  11. ttl : seconds to refresh cache (call aws api)
  12. checkperiod : the same
  13. deleteOnExpire : to delete cache when refresh
  14. #run server
  15. node index.js

Test locally

  1. curl localhost:8090
  2. It works!!

Grafana Datasource Configuration

  • Install Simple Json Datasource Plugin
  • Configure New Datasource using Server Access (if you want to use browser based access, change AUTH.enabled = false in the backend config file)


Grafana Dashboard Configuration

Sample Dashboard can be downloaded here

  • Last Month Costs Widget uses Last Month Aggregated Query - Table Type

  • Month to Date uses Month to date Aggregated Query - Table type

  • Year to date uses Timeseries

Todo:

  • Enable Tag Filtering (¿using variables?)
  • Implement annotations
  • Create docker image
  • Create AWS Cloud Formation script