Skip to content

Commit

Permalink
feat: Add "Average Power Consumption (kWh) Over Last Hour" panel to P…
Browse files Browse the repository at this point in the history
…ower Dashboard (#3180)

* feat: Add "Average Power Consumption (kWh) Over Last Hour" panel to Power Dashboard
  • Loading branch information
rahulguptajss authored Sep 27, 2024
1 parent acc870e commit 536c23b
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmd/tools/grafana/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ func TestUnitsAndExprMatch(t *testing.T) {
"qos_total_data": {"Bps", "percent"},
"aggr_space_used": {"bytes", "percent"},
"volume_size_used": {"bytes", "percent"},
"volume_num_compress_fail": {"short", "percent"},
"shelf_power": {"watt", "watth"},
"environment_sensor_power": {"watt", "watth"},
"volume_num_compress_fail": {"percent", "short"},
}

// Normalize rates to their base unit
Expand Down
150 changes: 147 additions & 3 deletions grafana/dashboards/cmode/power.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"gnetId": null,
"graphTooltip": 1,
"id": null,
"iteration": 1727100822194,
"iteration": 1727437918841,
"links": [
{
"asDropdown": true,
Expand Down Expand Up @@ -678,7 +678,7 @@
},
"gridPos": {
"h": 8,
"w": 24,
"w": 13,
"x": 0,
"y": 16
},
Expand Down Expand Up @@ -729,6 +729,150 @@
"title": "Total Power Consumed",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "This panel displays the average power consumption in kilowatt-hours (kWh) over the last hour for Nodes, Shelves, and the total combined.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "watth"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Node"
},
"properties": [
{
"id": "unit",
"value": "watth"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Shelf"
},
"properties": [
{
"id": "unit",
"value": "watth"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Total"
},
"properties": [
{
"id": "unit",
"value": "watth"
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 11,
"x": 13,
"y": 16
},
"id": 102,
"options": {
"legend": {
"calcs": [
"mean",
"lastNotNull",
"max"
],
"displayMode": "table",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.1.2",
"targets": [
{
"exemplar": false,
"expr": "sum(avg_over_time(environment_sensor_power{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}[1h]))",
"hide": false,
"interval": "",
"legendFormat": "Node",
"refId": "B"
},
{
"exemplar": false,
"expr": "sum(avg_over_time(shelf_power{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\"}[1h]))",
"hide": false,
"interval": "",
"legendFormat": "Shelf",
"refId": "A"
},
{
"exemplar": false,
"expr": "sum(\n avg_over_time(\n environment_sensor_power{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}[1h]\n )\n) + sum(\n avg_over_time(\n shelf_power{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\"}[1h]\n ) * on(datacenter, cluster, shelf) shelf_labels{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", isEmbedded=\"No\"}\n)",
"hide": false,
"interval": "",
"legendFormat": "Total",
"refId": "C"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Average Power Consumption (kWh) Over Last Hour",
"type": "timeseries"
},
{
"datasource": "${DS_PROMETHEUS}",
"description": "Power consumed by a node in Watts.",
Expand Down Expand Up @@ -3514,5 +3658,5 @@
"timezone": "",
"title": "ONTAP: Power",
"uid": "cdot-power",
"version": 15
"version": 16
}

0 comments on commit 536c23b

Please sign in to comment.