report the btrfs-subvolume root in host filesystem metrics
This commit is contained in:
parent
319dd6a808
commit
aeef4634e1
1 changed files with 67 additions and 1 deletions
|
|
@ -189,6 +189,29 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
collector.filesystemMountPoints = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [
|
||||
"/"
|
||||
"/boot"
|
||||
"/nix"
|
||||
];
|
||||
example = [
|
||||
"/"
|
||||
"/boot"
|
||||
"/data"
|
||||
];
|
||||
description = ''
|
||||
Mount points the host collector's `filesystem` scraper reports
|
||||
(`system.filesystem.*`), matched exactly. The list is strict because
|
||||
the scraper has to include virtual filesystems to see a btrfs
|
||||
subvolume root, and that would otherwise report every tmpfs, proc
|
||||
and cgroup mount plus each per-container btrfs subvolume, which
|
||||
repeats the same device's usage. A mount point on the list that a
|
||||
host does not have reports nothing.
|
||||
'';
|
||||
};
|
||||
|
||||
httpChecks = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
|
|
@ -480,7 +503,19 @@ in
|
|||
scrapers = {
|
||||
cpu = { };
|
||||
memory = { };
|
||||
filesystem = { };
|
||||
# `include_virtual_filesystems` turns gopsutil's `all` on.
|
||||
# With it off, a mount whose mountinfo root is not `/`
|
||||
# counts as a bind mount and is dropped, which includes a
|
||||
# btrfs `subvol=@` root. The strict list then keeps the
|
||||
# now-visible tmpfs, proc and per-container subvolume
|
||||
# mounts out of the store.
|
||||
filesystem = {
|
||||
include_virtual_filesystems = true;
|
||||
include_mount_points = {
|
||||
match_type = "strict";
|
||||
mount_points = otel.collector.filesystemMountPoints;
|
||||
};
|
||||
};
|
||||
load = { };
|
||||
disk = { };
|
||||
network = { };
|
||||
|
|
|
|||
Loading…
Reference in a new issue