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.
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 ec2 CloudWatch
To filter EC2, use -filters
.
$ gen-grafana-panel-json ec2 -filters tag:Name,dev-*,instance-type,t2.* CloudWatch
Give metric name, datasource name and prefix.
$ gen-grafana-panel-json sqs -m ApproximateNumberOfMessagesVisible CloudWatch dev-