Skip to content

Commit

Permalink
Fix EBS Read IOPS.
Browse files Browse the repository at this point in the history
Close #29
  • Loading branch information
mhuguesaws committed Mar 4, 2024
1 parent bc24277 commit c0c4442
Showing 1 changed file with 26 additions and 166 deletions.
192 changes: 26 additions & 166 deletions batch-grafana-dashboard-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -1260,102 +1260,31 @@
},
"targets": [
{
"alias": "{{'{{InstanceId}}'}}",
"datasource": {
"type": "cloudwatch",
"uid": "${DS_CLOUDWATCH}"
},
"id": "",
"region": "default",
"logGroups": [],
"queryMode": "Metrics",
"namespace": "AWS/EC2",
"metricName": "EBSWriteOps",
"expression": "",
"dimensions": {
"InstanceId": "$instanceid"
},
"expression": "",
"hide": false,
"id": "",
"matchExact": true,
"metricEditorMode": 0,
"metricName": "EBSWriteOps",
"metricQueryType": 0,
"namespace": "AWS/EC2",
"statistic": "Average",
"period": "",
"queryMode": "Metrics",
"metricQueryType": 0,
"metricEditorMode": 0,
"sqlExpression": "",
"matchExact": true,
"refId": "A",
"region": "default",
"sql": {
"from": {
"property": {
"name": "AWS/EC2",
"type": "string"
},
"type": "property"
},
"groupBy": {
"expressions": [
{
"property": {
"name": "InstanceId",
"type": "string"
},
"type": "groupBy"
}
],
"type": "and"
},
"orderBy": {
"name": "AVG",
"type": "function"
},
"orderByDirection": "ASC",
"select": {
"name": "AVG",
"parameters": [
{
"name": "EBSWriteBytes",
"type": "functionParameter"
}
],
"type": "function"
},
"where": {
"expressions": [
{
"operator": {
"name": "=",
"value": "$instanceid"
},
"property": {
"name": "InstanceId",
"type": "string"
},
"type": "operator"
}
],
"type": "and"
}
},
"sqlExpression": "SELECT AVG(EBSWriteBytes) FROM \"AWS/EC2\" WHERE InstanceId = '$instanceid' GROUP BY InstanceId ORDER BY AVG() ASC",
"statistic": "Average"
"label": "${PROP('Dim.InstanceId')}"
}
],
"title": "EBS Write IOPS",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "EBS Write IOPS",
"binary": {
"left": "EBSWriteOps_Average",
"operator": "/",
"reducer": "sum",
"right": "60"
},
"mode": "binary",
"reduce": {
"reducer": "sum"
},
"replaceFields": true
}
}
],
"type": "timeseries"
},
{
Expand Down Expand Up @@ -1429,100 +1358,31 @@
},
"targets": [
{
"alias": "{{'{{InstanceId}}'}}",
"datasource": {
"type": "cloudwatch",
"uid": "${DS_CLOUDWATCH}"
},
"id": "",
"region": "default",
"logGroups": [],
"queryMode": "Metrics",
"namespace": "AWS/EC2",
"metricName": "EBSReadOps",
"expression": "",
"dimensions": {
"InstanceId": "$instanceid"
},
"expression": "",
"id": "",
"matchExact": true,
"metricEditorMode": 0,
"metricName": "EBSReadBytes",
"metricQueryType": 0,
"namespace": "AWS/EC2",
"statistic": "Average",
"period": "",
"queryMode": "Metrics",
"metricQueryType": 0,
"metricEditorMode": 0,
"sqlExpression": "",
"matchExact": true,
"refId": "A",
"region": "default",
"sql": {
"from": {
"property": {
"name": "AWS/EC2",
"type": "string"
},
"type": "property"
},
"groupBy": {
"expressions": [
{
"property": {
"name": "InstanceId",
"type": "string"
},
"type": "groupBy"
}
],
"type": "and"
},
"orderByDirection": "ASC",
"select": {
"name": "AVG",
"parameters": [
{
"name": "EBSReadBytes",
"type": "functionParameter"
}
],
"type": "function"
},
"where": {
"expressions": [
{
"operator": {
"name": "=",
"value": "$instanceid"
},
"property": {
"name": "InstanceId",
"type": "string"
},
"type": "operator"
}
],
"type": "and"
}
},
"sqlExpression": "SELECT AVG(EBSReadBytes) FROM \"AWS/EC2\" WHERE InstanceId = '$instanceid' GROUP BY InstanceId",
"statistic": "Average"
"label": "${PROP('Dim.InstanceId')}"
}
],
"title": "EBS Read IOPS",
"transformations": [
{
"id": "calculateField",
"options": {
"alias": "EBS Read IOPS",
"binary": {
"left": "EBSReadBytes_Average",
"operator": "/",
"reducer": "sum",
"right": "60"
},
"mode": "binary",
"reduce": {
"include": [
"EBSReadBytes_Average"
],
"reducer": "sum"
},
"replaceFields": true
}
}
],
"type": "timeseries"
}
],
Expand Down

0 comments on commit c0c4442

Please sign in to comment.