-
Notifications
You must be signed in to change notification settings - Fork 6
/
overview.juttle
56 lines (49 loc) · 2.73 KB
/
overview.juttle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// This program demonstrates ways to use the aggregate and demographic
// information from the aws adapter as well as ways to use the
// cloudwatch adapter to identify problems.
//
// The program shows sample of aggregate and demographic information
// from AWS:
// - The number of EC2 instances
// - The total amount of RDS allocated storage
// - The total EBS volume capacity.
// The program also shows a sample of information from CloudWatch. The
// first barchart is the the top EC2 instances by CPU Utilization.
// The second subgraph identifies "problem" items and shows the number
// of items as a count and details as a table.
// For this program, "problem" items are:
// - EC2: Any instances with failed status checks.
// - ELB: Any load balancers where UnHealthyHostCount is > 0
// - Lambda: Any function with errors > 0
read mysql -table 'aws_aggregation' -from :1 hour ago: -to :end: -lag :20s: product='EC2' OR product='EBS' OR product='RDS'
| (filter product='EC2' AND metric_type='AWS Aggregate' AND aggregate='EC2 Instance Count'
| view tile -title "Number of EC2 Instances";
filter product='RDS' AND metric_type='AWS Aggregate' AND aggregate='RDS DB Total Allocated Storage'
| view tile -title "Total DB Allocated Storage (GB)";
filter product='EBS' AND metric_type='AWS Aggregate' AND aggregate='EBS Volume Total Iops'
| view tile -title "Total EBS Volume Capacity (Iops)";
);
read cloudwatch -last :1h: -period 3600 product="EC2" AND metric="CPUUtilization"
| sort value -desc
| head -10
| view barchart -categoryField "item"
-yScales.primary.label "CPUUtilization"
-title 'AWS Top EC2 Instances by CPUUtilization';
read cloudwatch -last :1h: -period 3600 -statistics ['Maximum'] metric='EC2:StatusCheckFailed_Instance' OR
metric='EC2:StatusCheckFailed_System' OR
metric='ELB:UnHealthyHostCount' OR
metric='Lambda:Errors'
| filter
// EC2: Any instances with failed status checks.
(product='EC2' AND value=1) OR
// ELB: Any load balancers where UnHealthyHostCount is > 0
(product='ELB' AND value > 0) OR
// Lambda: Any function with errors > 0
(product='Lambda' AND value > 0)
| head 1 by item
| keep time, product, name, value, item
| ( reduce cnt=count()
| put level=(cnt == 0 ? 'success' : 'error')
| view tile -valueField "cnt" -title "Number of Problem Items (EC2, ELB, Lambda)" -levelField "level";
view table -title "Items with problems" -columnOrder ["time", "product", "item", "name", "value"]
);