Skip to content

[CELEBORN-2403] Add worker metrics for disk status and unhealthy disk count - #3782

Open
yew1eb wants to merge 4 commits into
apache:mainfrom
yew1eb:worker-disk-status-metrics
Open

[CELEBORN-2403] Add worker metrics for disk status and unhealthy disk count#3782
yew1eb wants to merge 4 commits into
apache:mainfrom
yew1eb:worker-disk-status-metrics

Conversation

@yew1eb

@yew1eb yew1eb commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add two gauges on the worker to expose disk health status, registered in LocalDeviceMonitor.init() and evaluated lazily from the live DiskInfo.status at scrape time:

  1. UnhealthyDiskCount — the number of local disks whose status is not HEALTHY, intended for alerting (e.g. > 0).
  2. DiskStatus with a mountpoint label — the current DiskStatus value (0: HEALTHY, 1: READ_OR_WRITE_FAILURE, 2: IO_HANG, 3: HIGH_DISK_USAGE, 4: CRITICAL_ERROR) of each disk, for locating the exact unhealthy disk.

Also included: two corresponding panels in the Grafana dashboard (assets/grafana/celeborn-dashboard.json) and the new metrics in docs/monitoring.md.

Why are the changes needed?

DeviceMonitor already maintains DiskInfo.status for every local disk, but none of the existing metrics expose it — DeviceOSFreeBytes/DeviceCelebornFreeBytes report capacity, and Device_<name>_<Status>_Count only counts non-critical error events. To notice a broken disk, operators have to grep worker logs, which makes alerting on disk failures impossible.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

Two new worker metrics are exposed: UnhealthyDiskCount and DiskStatus (with a mountpoint label).

How was this patch tested?

  • Added a new test case monitor disk status metrics in DeviceMonitorSuite covering the multi-disk scenario: all disks healthy initially, then one disk marked READ_OR_WRITE_FAILURE (aggregate count becomes 1 and only that disk's gauge changes), then recovered to HEALTHY.
  • ./build/mvn test -pl worker passes.
  • python3 dev/lint_grafana.py assets/grafana/celeborn-dashboard.json passes.
  • ./build/mvn spotless:check -pl worker passes.

"color": "green"
},
{
"color": "red",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need for read color. Please verify the grafana dashboard.

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.

Fixed.

Comment thread assets/grafana/celeborn-dashboard.json Outdated
},
"editorMode": "code",
"expr": "metrics_DiskStatus_Value{instance=~\"${instance}\"}",
"legendFormat": "${baseLegend} {{mountpoint}}",

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.

The legendFormat here uses "${baseLegend} {{mountpoint}}", but all existing panels with labels (e.g. id=270, 271, 272) put the label variables before ${baseLegend} — e.g. "{{statusCode}} ${baseLegend}", "{{dbBackend}} {{operation}}/{{status}} ${baseLegend}".

For consistency, consider changing to "{{mountpoint}} ${baseLegend}".

Comment thread assets/grafana/celeborn-dashboard.json Outdated
"mode": "off"
}
},
"mappings": [],

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.

The mappings field is empty for the DiskStatus panel. Consider adding value mappings to map the numeric status values (0-4) to readable status names (HEALTHY, READ_OR_WRITE_FAILURE, IO_HANG, HIGH_DISK_USAGE, CRITICAL_ERROR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants