mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #436] [CLOSED] feat(ublk): expose device I/O and stalled request metrics #437
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/436
Author: @guozy18
Created: 10/25/2026
Status: ❌ Closed
Base:
main← Head:sync/ublk-device-io-metrics📝 Commits (1)
939c230feat: add ublk device-level IO metrics📊 Changes
8 files changed (+634 additions, -3 deletions)
View changed files
📝
Cargo.lock(+3 -0)📝
crates/observability/src/lib.rs(+16 -0)📝
docs/src/configuration/reference.md(+15 -0)📝
storage/ublk-daemon/src/main.rs(+4 -0)📝
storage/ublk/Cargo.toml(+3 -0)📝
storage/ublk/src/impls/overlaybd_target.rs(+32 -3)📝
storage/ublk/src/lib.rs(+2 -0)➕
storage/ublk/src/metrics.rs(+559 -0)📄 Description
What
Expose ublk device I/O requests, completed bytes, read/write latency and in-flight operations on the daemon's existing Prometheus endpoint. Series are aggregated by target and operation, without a device-ID label.
Why
Existing storage metrics do not show whether guest block requests complete, fail or remain stuck. Completion latency alone cannot reveal an I/O that never finishes.
Related issue
No linked issue.
Scope and non-goals
Record OverlayBD target I/O and publish aggregate daemon metrics. Preserve the current I/O results, error mapping, startup-pack recording, warm-pool image switching and storage ownership.
Design and behavior changes
Compatibility and operations
ublk.daemon_metrics_listen_addrremains unchanged. An empty address disables export; tracker/scanner bookkeeping still runs.Validation
make fmt(equivalentcargo fmt --all -- --check)make clippy(explicit package/all-target/all-feature command below)make test-unitmake -C services test(no Go changes)maketarget (no generated changes)Commands and results on isolated Linux, from this branch alone on
424b852:The original tracker tests cover the 30-second boundary, aggregation, guard removal and zeroing. The existing target tests cover device parameters, error mapping and sparse-image discard.
A non-root KVM node was also started with this branch's separate binaries. Real guest boot I/O appeared on the daemon endpoint with read/write counters, bytes, histograms and no
dev_idlabels. Snapshot publication and launch, pause/resume and pooled device reuse kept accounting active. After sandbox/snapshot deletion all four in-flight gauges returned to zero. Sandboxes, snapshots and processes were cleaned up.Skipped checks: unrelated aggregate VM/storage suites and Go checks. No throughput benchmark or deliberately stalled 30-second remote I/O experiment was performed; the slow-I/O boundary and cancellation cleanup are covered by deterministic tracker tests.
Risks and reviewer notes
Every read/write adds an insert/remove in the tracker and an unsampled latency observation; steady-state overhead has not been benchmarked. In-flight values are sampled every five seconds. The standalone ublk binary does not start this daemon scanner or Prometheus endpoint.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.