-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathebsperfv6.yml
179 lines (170 loc) · 7.59 KB
/
ebsperfv6.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "Cloudwatch Dashboard for EBS IOPs and throughput"
Parameters:
EBSAttached:
Description: "Attached Instance"
Type: String
Default: "none"
EBSVolumeMaxBW:
Description: "EBS Volume Throughput in MB."
Type: Number
MinValue: 125
MaxValue: 1000
Default: 250
EBSVolumeMaxIOPs:
Description: "EBS Volume Max IOPs."
Type: Number
MinValue: 3
MaxValue: 250000
Default: 3000
EBSVolumeSize:
Description: "EBS Volume Size in GB"
Type: Number
MinValue: 1
MaxValue: 65536
Default: 100
EBSVolumeId:
Description: "EBS Volume to Monitor."
Type: AWS::EC2::Volume::Id
AllowedPattern: "^[A-Za-z0-9_-]*$"
Default: vol-0a2ddbf3ee34e7d2a
EBSDashboardName:
Description: "Cloudwatch Dashboard Name."
Type: String
AllowedPattern: "^[A-Za-z0-9_-]*$"
Default: EBSDashboard3
Resources:
EBSDashboard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardBody: !Sub
'{
"widgets": [
{
"height": 6,
"width": 9,
"y": 0,
"x": 0,
"type": "metric",
"properties": {
"metrics": [
[ { "expression": "m1/PERIOD(m1)", "label": "Read IOPs", "id": "e1", "region": "${AWS::Region}" } ],
[ { "expression": "m2/PERIOD(m2)", "label": "Writes IOPs", "id": "e2", "region": "${AWS::Region}" } ],
[ { "expression": "e1+e2", "label": "Total IOPs", "id": "e3", "region": "${AWS::Region}" } ],
[ "AWS/EBS", "VolumeReadOps", "VolumeId", "${EBSVolumeId}", { "id": "m1", "visible": false } ],
[ ".", "VolumeWriteOps", ".", ".", { "id": "m2", "visible": false } ]
],
"view": "timeSeries",
"stacked": false,
"region": "${AWS::Region}",
"stat": "Sum",
"period": 60,
"yAxis": {
"left": {
"label": "IOPS",
"showUnits": false
},
"right": {
"label": "",
"showUnits": false
}
},
"annotations": {
"horizontal": [
{
"label": "IOPs Max",
"value": ${EBSVolumeMaxIOPs}
}
]
},
"title": "EBS IOPS"
}
},
{
"height": 6,
"width": 9,
"y": 0,
"x": 9,
"type": "metric",
"properties": {
"metrics": [
[ { "expression": "(m4/(1024*1024))/PERIOD(m4)", "label": "MB Read Per Second", "id": "e4", "region": "${AWS::Region}" } ],
[ { "expression": "(m3/(1024*1024))/PERIOD(m3)", "label": "MB Write Per Second", "id": "e5", "region": "${AWS::Region}" } ],
[ { "expression": "e4+e5", "label": "Total Consumed MB/s", "id": "e6", "region": "${AWS::Region}" } ],
[ "AWS/EBS", "VolumeWriteBytes", "VolumeId", "${EBSVolumeId}", { "id": "m3", "visible": false } ],
[ ".", "VolumeReadBytes", ".", ".", { "id": "m4", "visible": false } ]
],
"view": "timeSeries",
"stacked": false,
"region": "${AWS::Region}",
"stat": "Sum",
"period": 60,
"yAxis": {
"left": {
"label": "MB/s",
"showUnits": false
},
"right": {
"label": "",
"showUnits": false
}
},
"annotations": {
"horizontal": [
{
"label": "BW Max",
"value": ${EBSVolumeMaxBW}
}
]
},
"title": "EBS Throughput MB/s"
}
},
{
"type": "metric",
"x": 0,
"y": 6,
"width": 9,
"height": 6,
"properties": {
"metrics": [
[ { "expression": "e1+e2", "label": "Average Read/Write Combined Latency", "id": "e3", "region": "${AWS::Region}" } ],
[ { "expression": "(m2/m1)*1000", "label": "Average Read Latency", "id": "e1", "region": "${AWS::Region}" } ],
[ { "expression": "(m4/m3)*1000", "label": "Average Write Latency", "id": "e2", "region": "${AWS::Region}" } ],
[ "AWS/EBS", "VolumeTotalReadTime", "VolumeId", "${EBSVolumeId}", { "id": "m2", "visible": false } ],
[ ".", "VolumeReadOps", ".", ".", { "id": "m1", "visible": false } ],
[ ".", "VolumeTotalWriteTime", ".", ".", { "id": "m4", "visible": false } ],
[ ".", "VolumeWriteOps", ".", ".", { "id": "m3", "visible": false } ]
],
"view": "timeSeries",
"stacked": false,
"region": "${AWS::Region}",
"stat": "Sum",
"period": 60,
"title": "Volume Read Write Latency",
"yAxis": {
"left": {
"label": "ms",
"showUnits": false
}
}
}
},
{
"type": "text",
"x": 9,
"y": 6,
"width": 9,
"height": 6,
"properties": {
"markdown": "# EBS Volume Info \n \nParameter | Value \n----|----- \nVolumeId | [${EBSVolumeId}](https://console.aws.amazon.com/ec2/v2/home?region=${AWS::Region}#Volumes:volumeId=${EBSVolumeId};sort=desc:createTime) \nVolumeSize | ${EBSVolumeSize} GB\nVolumeIOPs | ${EBSVolumeMaxIOPs} IOPs\nVolumeThroughput | ${EBSVolumeMaxBW} MB/s\nAttached Instance | [${EBSAttached}](https://console.aws.amazon.com/ec2/v2/home?region=${AWS::Region}#Instances:search=${EBSAttached};sort=desc:instanceId)\n"
}
}
]
}'
DashboardName: !Ref EBSDashboardName
Outputs:
EBSPerformanceDashboard:
Description: "Link to CloudWatch Dashboard"
Value: !Sub "https://console.aws.amazon.com/cloudwatch/home?region=${AWS::Region}#dashboards:name=${EBSDashboardName}"