Skip to content

feat(agent): send the disk activity, and conform to contract v0.4.0 - #48

Merged
nabil1440 merged 2 commits into
agent/42-pressurefrom
agent/43-disk-activity
Sep 28, 2026
Merged

nabil1440 merged 2 commits into
agent/42-pressurefrom
agent/43-disk-activity

Conversation

@nabil1440

@nabil1440 nabil1440 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #43.

Part of the monitoring agent stack. This PR is on top of #47. Contract v0.4.0, "Disk activity". After this PR, the agent conforms to contract v0.4.0, and the README pins it.

What changes

  • At each reading, the agent reads /proc/diskstats.
  • Which disks. Each disk in /sys/block with a device link, for example vda, sda or nvme0n1. Partitions are not in /sys/block. Loop, ram, zram, device mapper and software RAID disks have no device. All hardware disks count, not only the disk of /.
  • The completed reads and writes are columns 4 and 8. The sectors read and written are columns 6 and 10, times 512.
  • New optional sample fields: disk_read_bytes, disk_write_bytes, disk_read_ops, disk_write_ops, and the four peaks each second disk_read_max_bytes_per_second, disk_write_max_bytes_per_second, disk_read_max_ops_per_second and disk_write_max_ops_per_second.
  • The agent adds the disks that both readings of a window have. A disk that appears or goes away makes no spike.
  • All eight fields are null in the first sample, after a reboot, after a reading older than 90 seconds, when no disk has a hardware device, and when a counter went back, also inside one window.
  • The pin in the README, the package documentation and wire moves to v0.4.0. Before this PR, wire.go still said v0.2.1.

Tests

  • The parser with a real /proc/diskstats of a cloud server and with the 14 columns of an older kernel, the choice of disks, the values and the peaks, a new disk, a reading without disks, a counter that went back in the minute and in one window, and the cases of null.
  • make check passes.

@nabil1440
nabil1440 added this pull request to stack #38 September 24, 2026 06:06
@nabil1440 nabil1440 changed the title agent/43 disk activity feat(agent): send the disk activity, and conform to contract v0.4.0 Sep 24, 2026
@nabil1440
nabil1440 marked this pull request as ready for review September 24, 2026 06:07
@nabil1440
nabil1440 force-pushed the agent/43-disk-activity branch from 473cff6 to 8333996 Compare September 24, 2026 08:09
Contract v0.4.0, "Disk activity": the bytes and the operations that the
hardware disks read and wrote in the minute, from /proc/diskstats, and
their peaks each second within the minute. null in the first sample,
after a reboot, after a counter went back, and without a hardware disk.

The README pins contract v0.4.0.

Closes #43
… minute

The contract makes all eight disk fields null when a counter went back.
A disk that is attached again under the same name can pass the check of
the minute and still give a wrong delta; now a window that went back
nulls the values of the minute too. A reading with no disks for a moment
joins its windows.
@nabil1440
nabil1440 force-pushed the agent/43-disk-activity branch from 8333996 to 1755fcf Compare September 24, 2026 08:14
@nabil1440
nabil1440 merged commit 8f55a1c into develop Sep 28, 2026
1 of 2 checks passed
@nabil1440
nabil1440 deleted the agent/43-disk-activity branch September 28, 2026 03:26
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.

feature: Send the disk activity — bytes and operations

1 participant