Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[receiver/dockerstatsreceiver] Add metrics that are only available on…
… hosts that use cgroups v2 (#22706) **Description:** This PR updates the documentation of all the metrics that are available only on cgroups v1 or cgroups v2. It PR also adds two metrics that are only available when the host is using cgroups v2: * `container.memory.anon` * `container.memory.file` Both are documented here: https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files I enabled the metric `container.memory.file` by default (causing a breaking change) because it is a metric that was already scraped for cgroups v1, contained in the metric `container.memory.total_cache`. ```yaml container.memory.total_cache: enabled: true description: "Total amount of memory used by the processes of this cgroup (and descendants) that can be associated with a block on a block device. Also accounts for memory used by tmpfs (Only available with cgroups v1)." container.memory.file: enabled: true description: "Amount of memory used to cache filesystem data, including tmpfs and shared memory (Only available with cgroups v2)." ``` Let me know your thoughts about this breaking change. **Link to tracking Issue:** #21097 **Testing:** The refactor done during PR #21110 had mocks ready to test these new metrics. There is no need to add more tests. **Documentation:** To see which metrics are available in Docker: * v1: https://github.com/moby/moby/blob/7103efac9d737e8b202126e8c8e2227805e70771/daemon/stats_unix.go#L86 * v2: https://github.com/moby/moby/blob/7103efac9d737e8b202126e8c8e2227805e70771/daemon/stats_unix.go#L195 Kernel cgroup documentation: * v1: https://docs.kernel.org/admin-guide/cgroup-v1/memory.html * v2: https://docs.kernel.org/admin-guide/cgroup-v2.html#memory-interface-files
- Loading branch information