kubernetes/vendor/github.com/prometheus/procfs
Stephen Kitt 684473af62
Bump cadvisor to 0.53
This brings a few fixes, drops github.com/pkg/errors (as a direct
dependency), and bumps many transitive dependencies. The
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp bump to
v0.61.0 breaks "k8s.io/kubernetes/test/integration/apiserver: tracing"
consistently, so it's held back for now.

github.com/containerd/containerd/api pulls in gopkg.in/yaml.v3 so that
needs to be added to the exceptions in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-28 09:20:21 +02:00
..
internal Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
.gitignore Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
.golangci.yml Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
arp.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
buddyinfo.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
cmdline.go upgrade prometheus/client_golang to v1.12.0(common to v0.32.1) 2022-01-19 22:30:33 +08:00
CODE_OF_CONDUCT.md Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
CONTRIBUTING.md Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
cpuinfo_armx.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo_loong64.go update prometheus/client_golang v1.14.0 to v1.16.0 2023-06-15 11:24:32 +00:00
cpuinfo_mipsx.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo_others.go update prometheus/client_golang v1.14.0 to v1.16.0 2023-06-15 11:24:32 +00:00
cpuinfo_ppcx.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo_riscvx.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo_s390x.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
cpuinfo_x86.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
crypto.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
doc.go update prometheus/client_golang v1.14.0 to v1.16.0 2023-06-15 11:24:32 +00:00
fs.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
fs_statfs_notype.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
fs_statfs_type.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
fscache.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
ipvs.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
kernel_random.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
LICENSE
loadavg.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
MAINTAINERS.md Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
Makefile Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
Makefile.common Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
mdstat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
meminfo.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
mountinfo.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
mountstats.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_conntrackstat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
net_dev.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
net_dev_snmp6.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_ip_socket.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_protocols.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_route.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
net_sockstat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
net_softnet.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
net_tcp.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_tls_stat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
net_udp.go Update to etcd v3.5.0 client 2021-06-15 22:50:46 -04:00
net_unix.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
net_wireless.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
net_xfrm.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
netstat.go update prometheus/client_golang v1.14.0 to v1.16.0 2023-06-15 11:24:32 +00:00
NOTICE
proc.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_cgroup.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_cgroups.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
proc_environ.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
proc_fdinfo.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
proc_interrupts.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
proc_io.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_limits.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
proc_maps.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
proc_netstat.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_ns.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
proc_psi.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
proc_smaps.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_snmp.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_snmp6.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_stat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
proc_status.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
proc_sys.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
README.md Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
schedstat.go Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
SECURITY.md Bump prometheus/client_golang to v1.13.0 2022-08-26 05:40:17 +02:00
slab.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
softirqs.go Bump cadvisor to 0.53 2025-08-28 09:20:21 +02:00
stat.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
swaps.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
thread.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00
ttar
vm.go upgrade: upgrade dependencies github.com/prometheus/common to the newest version 2024-04-20 09:53:16 +08:00
zoneinfo.go Bump prometheus/common to v0.55.0 2024-06-27 09:34:23 -04:00

procfs

This package provides functions to retrieve system, kernel, and process metrics from the pseudo-filesystems /proc and /sys.

WARNING: This package is a work in progress. Its API may still break in backwards-incompatible ways without warnings. Use it at your own risk.

Go Reference CircleCI Go Report Card

Usage

The procfs library is organized by packages based on whether the gathered data is coming from /proc, /sys, or both. Each package contains an FS type which represents the path to either /proc, /sys, or both. For example, cpu statistics are gathered from /proc/stat and are available via the root procfs package. First, the proc filesystem mount point is initialized, and then the stat information is read.

fs, err := procfs.NewFS("/proc")
stats, err := fs.Stat()

Some sub-packages such as blockdevice, require access to both the proc and sys filesystems.

    fs, err := blockdevice.NewFS("/proc", "/sys")
    stats, err := fs.ProcDiskstats()

Package Organization

The packages in this project are organized according to (1) whether the data comes from the /proc or /sys filesystem and (2) the type of information being retrieved. For example, most process information can be gathered from the functions in the root procfs package. Information about block devices such as disk drives is available in the blockdevices sub-package.

Building and Testing

The procfs library is intended to be built as part of another application, so there are no distributable binaries.
However, most of the API includes unit tests which can be run with make test.

Updating Test Fixtures

The procfs library includes a set of test fixtures which include many example files from the /proc and /sys filesystems. These fixtures are included as a ttar file which is extracted automatically during testing. To add/update the test fixtures, first ensure the testdata/fixtures directory is up to date by removing the existing directory and then extracting the ttar file using make testdata/fixtures/.unpacked or just make test.

rm -rf testdata/fixtures
make test

Next, make the required changes to the extracted files in the testdata/fixtures directory. When the changes are complete, run make update_fixtures to create a new fixtures.ttar file based on the updated fixtures directory. And finally, verify the changes using git diff testdata/fixtures.ttar.