No description, website, or topics provided.
Go Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
Makefile
README.md
glide.lock
glide.yaml
main.go

README.md

README

Generate Grafana panel JSON for CloudWatch datasource.

Grafana has HTTP API but at a glance it doens't have APIs for panel operations. We con configure panels with JSON. This command generates JSONs for panels which datasource is CloudWatch.

How to use

You need to configure ~/.aws/credentials first.

Generate a Grafana panel JSON for all EC2 instances in ap-northeast-1 for CPUUtilization.

$ gen-grafana-panel-json -datasource CloudWatch

Switching profile.

$ AWS_PROFILE=staging gen-grafana-panel-json -datasource CloudWatch -region us-west-2

To filter EC2, use -filters.

$ gen-grafana-panel-json -datasource CloudWatch -filters tag:Name,dev-*,instance-type,t2.small

To exclude some elements in targets, use jq and -stdin option.

$ gen-grafana-panel-json -datasource CloudWatch \
  | jq '[.targets[]|select((.alias|test("dev-.*"))|not)]' \
  | gen-grafana-panel-json -stdin