HDDS-15396. Grafana dashboard for disk balancer - #10609
Conversation
|
The metric name needs to update, because the volume info metric class produces metrics names like this: where the metric name is appended with the volume root directory path. |
Gargi-jais11
left a comment
There was a problem hiding this comment.
Thanks @navinko for working on the patch.
Left review comments below
|
Thanks @Gargi-jais11 for the review. Updated the changes and tried addressing suggestions.
|
Gargi-jais11
left a comment
There was a problem hiding this comment.
Thanks @navinko for updating the patch.
Just few more fixes to be done.
| } | ||
| ] | ||
| }, | ||
| "description": "", |
There was a problem hiding this comment.
| "description": "", | |
| "description": "Monitors Ozone Disk Balancer progress, throughput, and idle state per datanode.", |
| "uid": "${datasource}" | ||
| }, | ||
| "expr": "sum({__name__=~\"volume_info_metrics_.*_ozone_used\", instance=~\"$datanode\"}) by (instance, storagedirectory)", | ||
| "legendFormat": "{{storagedirectory}}", |
There was a problem hiding this comment.
With multiple datanodes selected, duplicate paths from different hosts are indistinguishable.
| "legendFormat": "{{storagedirectory}}", | |
| "legendFormat": "{{instance}} {{storagedirectory}}", |
| "type": "prometheus", | ||
| "uid": "${datasource}" | ||
| }, | ||
| "expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1m])", |
There was a problem hiding this comment.
[1m] at a typical 15s Prometheus scrape interval gives only 4 samples. This makes "Active Balancing Throughput Speed" extremely spiky. Use [$__rate_interval] (Grafana auto-calculates the appropriate window) or at minimum [5m].
| "expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1m])", | |
| "expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[$__rate_interval])", |
| } | ||
| ] | ||
| }, | ||
| "unit": "m" |
There was a problem hiding this comment.
If diskbalancer is in runnign state but not actively balancing than showing "0mins is ambigous"
| "unit": "m" | |
| "unit": "m", | |
| "noValue": "N/A" |
| "expr": "{__name__=~\"disk_balancer_service_metrics_move_success_time_avg_time|disk_balancer_service_metrics_move_failure_time_avg_time\", instance=~\"$datanode\"}", | ||
| "legendFormat": "{{__name__}}", | ||
| "refId": "A" | ||
| } | ||
| ], |
There was a problem hiding this comment.
better to break it in this way.
| "expr": "{__name__=~\"disk_balancer_service_metrics_move_success_time_avg_time|disk_balancer_service_metrics_move_failure_time_avg_time\", instance=~\"$datanode\"}", | |
| "legendFormat": "{{__name__}}", | |
| "refId": "A" | |
| } | |
| ], | |
| "expr": "disk_balancer_service_metrics_move_success_time_avg_time{instance=~\"$datanode\"}", | |
| "legendFormat": "{{instance}} success avg latency", | |
| "refId": "A" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${datasource}" | |
| }, | |
| "expr": "disk_balancer_service_metrics_move_failure_time_avg_time{instance=~\"$datanode\"}", | |
| "legendFormat": "{{instance}} failure avg latency", | |
| "refId": "B" | |
| }, | |
| { | |
| "datasource": { | |
| "type": "prometheus", | |
| "uid": "${datasource}" | |
| }, | |
| "expr": "disk_balancer_service_metrics_move_success_time_num_ops{instance=~\"$datanode\"}", | |
| "legendFormat": "{{instance}} moves/interval", | |
| "refId": "C" | |
| } | |
| ], |
| "type": "prometheus", | ||
| "uid": "${datasource}" | ||
| }, | ||
| "expr": "max_over_time(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1h])", |
There was a problem hiding this comment.
Same the counter is cumulative:
| "expr": "max_over_time(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1h])", | |
| "expr": "disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}", |
| "type": "prometheus", | ||
| "uid": "${datasource}" | ||
| }, | ||
| "expr": "max_over_time(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"}[1h])", |
There was a problem hiding this comment.
Same cumulative counter.
| "expr": "max_over_time(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"}[1h])", | |
| "expr": "(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"})", |
There was a problem hiding this comment.
It's giving bad data : invalid parameter hence used [1h]
| "title": "Balancer Idle Reason", | ||
| "type": "piechart" | ||
| } | ||
| ], |
There was a problem hiding this comment.
There is one more metrics which shows how many times a balancer is iterating through the loop if balancer is running.
Roughly I created this locally u can change it accordingly.
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"description": "Rate of disk balancer scheduler loop iterations per second. A non-zero value confirms the balancer process is alive and iterating. If this drops to zero while the balancer is expected to run, the service may have stalled or been stopped.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "loops/sec",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"showValues": false,
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 20
},
"id": 16,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
},
"pluginVersion": "13.0.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
},
"expr": "rate(disk_balancer_service_metrics_running_loop_count{instance=~\"$datanode\"}[$__rate_interval])",
"legendFormat": "{{instance}} loop rate",
"refId": "A"
}
],
"title": "Balancer Heartbeat \u2014 Scheduler Loop Rate",
"type": "timeseries"
}
| "preload": false, | ||
| "refresh": "5s", | ||
| "schemaVersion": 42, | ||
| "tags": [], |
There was a problem hiding this comment.
Let's give tag:
| "tags": [], | |
| "tags": [ | |
| "ozone", | |
| "datanode", | |
| "disk-balancer" | |
| ], |
There was a problem hiding this comment.
Added tag as suggested.
| "expr": "sum(increase(disk_balancer_service_metrics_idle_loop_no_available_volume_pair_count{instance=~\"$datanode\"}[15m]))", | ||
| "instant": true, |
There was a problem hiding this comment.
| "expr": "sum(increase(disk_balancer_service_metrics_idle_loop_no_available_volume_pair_count{instance=~\"$datanode\"}[15m]))", | |
| "instant": true, | |
| "expr": "sum(increase(disk_balancer_service_metrics_idle_loop_no_available_volume_pair_count{instance=~\"$datanode\"}[$__range]))", | |
| "instant": false, |
|
Thanks @Gargi-jais11 for the review . Updated the json with addressed review comments.
|


















What changes were proposed in this pull request?
Created brand new grafana dashboard for disk balancer.
Used already exposed prometheus matrices for disk balancer.
Please describe your PR in detail:
Used volume_info_metrics + below metrices in Grafana dashboard for tracking
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15396
How was this patch tested?
Simulated skew disk for datanode in my mac-> Triggered disk balancer through CLI using docker-compose -> Captured dashboard screen shot and validated panel
Used same json "Ozone - Disk Balancer.json" for current PR
Screen shots for references: