Skip to content

HDDS-15396. Grafana dashboard for disk balancer - #10609

Open
navinko wants to merge 6 commits into
apache:masterfrom
navinko:HDDS-15396
Open

HDDS-15396. Grafana dashboard for disk balancer#10609
navinko wants to merge 6 commits into
apache:masterfrom
navinko:HDDS-15396

Conversation

@navinko

@navinko navinko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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

image

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:

Screenshot 2026-06-25 at 8 52 53 PM Screenshot 2026-06-25 at 8 53 28 PM Screenshot 2026-06-25 at 8 54 25 PM Screenshot 2026-06-25 at 8 55 05 PM image Screenshot 2026-06-25 at 9 01 48 PM

@jojochuang

Copy link
Copy Markdown
Contributor

The metric name needs to update, because the volume info metric class produces metrics names like this:

volume_info_metrics_data_12_hadoop_ozone_datanode_data_vadiraja_reserved{context="ozone",storagetype="DISK",datanodeuuid="8f6f944b-77b3-4a95-91da-c9d9b51d773b",volumetype="DATA_VOLUME",storagedirectory="/data/12/hadoop-ozone/datanode/data/vadiraja/hdds",volumestate="NORMAL",hostname="drc6-oz-worker07.sjc.cloudera.com"}

where the metric name is appended with the volume root directory path.

@navinko
navinko requested a review from jojochuang June 28, 2026 05:16
@ivandika3
ivandika3 requested a review from Gargi-jais11 July 7, 2026 02:42
@Gargi-jais11
Gargi-jais11 requested a review from ChenSammi July 15, 2026 06:00

@Gargi-jais11 Gargi-jais11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @navinko for working on the patch.
Left review comments below

@navinko

navinko commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Gargi-jais11 for the review. Updated the changes and tried addressing suggestions.
Few more screenshot based on local testing.

image image image image image image image image image image image image

@navinko
navinko requested a review from Gargi-jais11 July 18, 2026 17:16

@Gargi-jais11 Gargi-jais11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @navinko for updating the patch.
Just few more fixes to be done.

}
]
},
"description": "",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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}}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With multiple datanodes selected, duplicate paths from different hosts are indistinguishable.

Suggested change
"legendFormat": "{{storagedirectory}}",
"legendFormat": "{{instance}} {{storagedirectory}}",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"type": "prometheus",
"uid": "${datasource}"
},
"expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1m])",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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].

Suggested change
"expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1m])",
"expr": "rate(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[$__rate_interval])",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
]
},
"unit": "m"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If diskbalancer is in runnign state but not actively balancing than showing "0mins is ambigous"

Suggested change
"unit": "m"
"unit": "m",
"noValue": "N/A"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines +352 to +356
"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"
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to break it in this way.

Suggested change
"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"
}
],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"type": "prometheus",
"uid": "${datasource}"
},
"expr": "max_over_time(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1h])",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same the counter is cumulative:

Suggested change
"expr": "max_over_time(disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}[1h])",
"expr": "disk_balancer_service_metrics_success_bytes{instance=~\"$datanode\"}",

@navinko navinko Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It's giving bad data : invalid parameter hence used [1h]

image

"type": "prometheus",
"uid": "${datasource}"
},
"expr": "max_over_time(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"}[1h])",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same cumulative counter.

Suggested change
"expr": "max_over_time(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"}[1h])",
"expr": "(disk_balancer_service_metrics_failure_count{instance=~\"$datanode\"})",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's giving bad data : invalid parameter hence used [1h]

"title": "Balancer Idle Reason",
"type": "piechart"
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
    }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing , Created new panel -
image

"preload": false,
"refresh": "5s",
"schemaVersion": 42,
"tags": [],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give tag:

Suggested change
"tags": [],
"tags": [
"ozone",
"datanode",
"disk-balancer"
],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tag as suggested.

Comment on lines +878 to +879
"expr": "sum(increase(disk_balancer_service_metrics_idle_loop_no_available_volume_pair_count{instance=~\"$datanode\"}[15m]))",
"instant": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@navinko
navinko marked this pull request as draft July 22, 2026 17:00
@navinko

navinko commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Gargi-jais11 for the review . Updated the json with addressed review comments.

image image image

@navinko
navinko marked this pull request as ready for review August 6, 2026 18:38
@navinko
navinko requested a review from Gargi-jais11 August 6, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants