diskstats: ignore zram devices on linux systems by default (#2898)

Signed-off-by: DBS-ST-VIT <dbs-st-vit@users.noreply.github.com>
Co-authored-by: DBS-ST-VIT <dbs-st-vit@users.noreply.github.com>
This commit is contained in:
DBS-ST-VIT 2024-01-15 09:32:58 +01:00 committed by GitHub
parent f18cd07fff
commit e22174ca8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ const (
// See also https://www.kernel.org/doc/Documentation/block/stat.txt
unixSectorSize = 512.0
diskstatsDefaultIgnoredDevices = "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$"
diskstatsDefaultIgnoredDevices = "^(z?ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$"
// See udevadm(8).
udevDevicePropertyPrefix = "E:"

View File

@ -53,7 +53,7 @@ func TestDiskStats(t *testing.T) {
*sysPath = "fixtures/sys"
*procPath = "fixtures/proc"
*udevDataPath = "fixtures/udev/data"
*diskstatsDeviceExclude = "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$"
*diskstatsDeviceExclude = "^(z?ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$"
testcase := `# HELP node_disk_ata_rotation_rate_rpm ATA disk rotation rate in RPMs (0 for SSDs).
# TYPE node_disk_ata_rotation_rate_rpm gauge
node_disk_ata_rotation_rate_rpm{device="sda"} 7200