Commit graph

1091 commits

Author SHA1 Message Date
Bryan Boreham b57f5bab2d
Fix logging race in systemd_linux.go (#3364)
The same variable was used for timing every parallel operation.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-07-26 19:35:01 +02:00
Naoki MATSUMOTO 05c68e2040
Add collector for PCIe devices with link information (#3339)
* Add collector for PCIe devices with link information

The link status of PCIe devices sometimes changes,
like link or speed downgrades, and devices disappear.
This patch collects PCIe devices' link infromation  to detect such failures.

As a first step, this collector exports PCIe devices'
- Device information (vendor_id, device_id, etc.)
- Parent PCIe device (e.g. PCIe bridge, PCIe switch)
- Link status (max_link_{transfers_per_second|width}, current_link_{transfers_per_second|width})

---------

Signed-off-by: Naoki MATSUMOTO <m.naoki9911@gmail.com>
2025-07-25 15:58:50 +02:00
Ben Kochie 6588cc636b
Update procfs library (#3355)
Update procfs library and adjust fixtures for update.

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-07-07 15:02:39 +02:00
mengxun 2179f0a34d
fix:use %w to wrap error (#3345)
Signed-off-by: mengxun <mengxun1122@163.com>
2025-06-11 17:00:43 +02:00
Manuel Rüger 2a2f16cd28
chore: Lint with golangci-lint v2 (#3301)
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2025-05-31 08:08:50 +02:00
Johannes Ziemke 7e801c90c3 AIX: Add netinterface collector
While having overlap with NetAdpter metrics, the metrics are slightly different
so need to be exposed as well.

Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 709388ed15 AIX: Fix disk blocks to bytes conversion
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 4d053b94a9 AIX: Remove redundant disk blocks metric, fix times
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 0e8817612a AIX: Fix physical cpu usage calculation
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 940e73b895 AIX: Add context switches to cpu collector
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 0cb7b61fd6 AIX: Add partition stats
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 430023e7e2 AIX: Add netadapter collision counters
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 481b824b08 AIX: Add transmit_queue_overflow metric to netdev collector
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 65d2538f14 AIX: Add paging memory metrics
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 2c33bc58ea AIX: Add more disk metrics
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Johannes Ziemke 853af0cec0 AIX: Add physical cpu, runqueue and flag metrics
Signed-off-by: Johannes Ziemke <github@5pi.de>
2025-05-28 19:19:02 +02:00
Nabil e942bae99f
chore: fix some typos (#3316)
Signed-off-by: Nabil <nabilcharaf37@gmail.com>
2025-05-21 19:53:59 +02:00
Guillaume E. 45eb59d29e
Fix ethtool returning 0 for sanitized metrics (#3335)
The ethtool_linux looks for ethtool stats with their sanitized name
which might be different from the name provisioned by ethtool.

This caused node-exporter to return a 0-value for sanitized metrics.

This patch works-around the missing key by copying ethtool stats
to another map under their sanitized name.

Signed-off-by: Guillaume Espanel <guillaume.espanel@ovhcloud.com>
Co-authored-by: Guillaume Espanel <guillaume.espanel@ovhcloud.com>
2025-05-19 11:41:17 +02:00
Siavash Safi 979a349637
fix: darwin netdev i/o bytes metric (#3336)
There is a bug in darwin kernel since macOS Ventura 13.2.1,
which results in interface i/o bytes values to be truncated at 4GiB.
This change uses a workaround to collect the same metrics,
taking advantage of another bug.

fixes #3333

Signed-off-by: Siavash Safi <git@hosted.run>
2025-05-18 11:53:48 +02:00
Charlie Chiang 43fb05c81d
Fix macos filesystem collector cgo memory leak (#3315)
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
2025-05-15 08:41:20 +02:00
Ben Kochie 38d32a3977
pressure: Fix missing IRQ on older kernels (#3263)
Fix "no data" error on kernels that support some PSI status, but don't
yet have IRQ presure metrics. Only report "no data" error if `pressure`
is enabled and no PSI metrics were found.

Fixes: https://github.com/prometheus/node_exporter/issues/3259

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-03-31 17:52:53 +02:00
dependabot[bot] e44309c825
build(deps): bump github.com/prometheus/client_golang from 1.20.5 to 1.21.0 (#3262)
* build(deps): bump github.com/prometheus/client_golang

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.20.5 to 1.21.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.5...v1.21.0)

Signed-off-by: Ben Kochie <superq@gmail.com>

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update e2e fixtures for new client_golang.

Signed-off-by: Ben Kochie <superq@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2025-03-31 12:47:39 +02:00
Manuel Rüger 8804ce1551
diskstats: Simplify condition (#3290)
As the comment says, this can be simplified now.

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2025-03-31 12:47:22 +02:00
Ben Kochie e5caa394c8
Sanitize darwin thermal strings (#3294)
Use `utils.SafeBytesToString()` to sanitize C strings the Darwin
thermal collector.

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-03-31 12:46:39 +02:00
Ben Kochie 729a03136f
Fix OpenBSD interrupt device parsing (#3288)
Sanitize zero terminated strings from OpenBSD device name parsing.
* Add byte-to-string util function.

Fixes: https://github.com/prometheus/node_exporter/issues/3287

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-03-31 11:00:34 +02:00
Ben Kochie e768aad83d
Fix flaky Solaris test (#3289)
Ignore `node_cpu_frequency_max_hertz` to fix flaky Solaris end-to-end
test.

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-03-28 10:48:44 +01:00
Ben Kochie 58ac08e216
Fix linter warning (#3280)
Fix S1009: should omit nil check; len() for nil maps is defined as zero (gosimple)

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-03-27 09:57:33 +01:00
Rolf Klemenz 47e2bb34ce
Avoid memory leak by using value rather than reference. (#3277)
Signed-off-by: Rolf Klemenz <tickez@madnet.ch>
2025-03-26 15:30:46 +01:00
Pranshu Srivastava 0c10545e8d
collector/mdadm: Support RAID metrics (#3031)
Use `sysfs` for RAID stats.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-02-24 10:19:48 +01:00
Ibrahim Awwad 6cfb6437fc
feat: add SystemdVirtualization type (#3254)
* feat: add SystemdVirtualization type
---------

Signed-off-by: IbraAoad <Ibrahim.Awwad@canonical.com>
Signed-off-by: Ibrahim Awwad <ibraaoad@gmail.com>
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Signed-off-by: Alexander Soelberg Heidarsson <89837986+alex5517@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
Co-authored-by: Alexander Soelberg Heidarsson <89837986+alex5517@users.noreply.github.com>
2025-02-23 13:26:37 +01:00
Tobias Nygren cab75a8011
collector/cpu_netbsd: fix 32-bit host support and plug memory leak (#3083)
Signed-off-by: Ben Kochie <superq@gmail.com>
2025-02-16 11:40:29 +01:00
Will Jordan edc40d1e0b
collector/ethtool: skip full scan of NetClass directories (#3239)
ethtool only uses the device names from `NetClassDevices()`,
not the whole NetClass data from `NetClass()`.
Improves ethtool collector performance on systems with lots of excluded devices.

Signed-off-by: Will Jordan <will.jordan@gmail.com>
2025-02-15 09:32:59 +01:00
Pranshu Srivastava 2f2113376f
chore: ignore/include metrics for FreeBSD (#3242)
* chore: ignore/include metrics for FreeBSD

Ignore non-deterministic metrics and include deterministic ones.

Use go123 for NetBSD from upstream release channel rather than the
package manager as that doesn't exist.
* https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/10.0_2024Q4/All/

---------

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-02-15 09:31:59 +01:00
Pranshu Srivastava 0cceb77065 fixup! chore: add xBSD pipelines
Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-02-04 10:45:56 +01:00
Pranshu Srivastava 3430dcfab8 chore: add xBSD pipelines
For integration tests.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support non-linux GOOS in e2e tests

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support e2e tests on freebsd

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support e2e tests on openbsd

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support e2e tests on netbsd

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support e2e tests on solaris

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: support e2e tests on dragonfly

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>

chore: drop support for e2e tests on solaris

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-02-04 10:45:56 +01:00
Ben Kochie 38f71f576c
Fix unused value (#3236)
Remove unused `queueDescs` value from diskstats collector.

Signed-off-by: Ben Kochie <superq@gmail.com>
2025-02-04 09:57:00 +01:00
Pranshu Srivastava 9889bcd757
collector/diskstats: add block device rotational (#3022)
* collector/diskstats: add block device rotational

Add metric to indicate if a device is rotational or not.

Fixes: #2956

---------

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2025-02-04 09:39:42 +01:00
khafatech e056e1b906
zfs: Allow space in dataset name (#3186)
* zfs: Allow space in dataset name

Signed-off-by: Mustafa Khafateh <m@khafateh.com>

* zfs: update fixture output for arm64

Signed-off-by: Mustafa Khafateh <m@khafateh.com>

* zfs: change pool3 name in fixture objsets

Signed-off-by: Mustafa Khafateh <m@khafateh.com>

* zfs: rename pool3 consistently in test case

Signed-off-by: Mustafa Khafateh <m@khafateh.com>

* zfs: Update amd64 e2e fixtures output

Signed-off-by: Mustafa Khafateh <m@khafateh.com>

---------

Signed-off-by: Mustafa Khafateh <m@khafateh.com>
2025-02-02 11:50:41 +01:00
K Rin 43dfdcea5c
Add collector for netstats tcp packet counters for FreeBSD. (#3177)
* Add collector for netstats tcp packet counters for FreeBSD.

Signed-off-by: K Rin <rin@sandb0x.tw>

* Update collector/netstat_freebsd.go to keep the naming convention

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: K Rin <sandb0x.tw0913@gmail.com>

---------

Signed-off-by: K Rin <rin@sandb0x.tw>
Signed-off-by: K Rin <sandb0x.tw0913@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2025-02-02 11:32:08 +01:00
Denis Fondras 963158df0a
Enable purgeable space reporting (#3206)
Signed-off-by: Denis <denis@jig-ai.ledeuns.net>
Co-authored-by: Denis <denis@jig-ai.ledeuns.net>
2025-02-02 11:16:00 +01:00
Vitaly Orlov 810510e12b
Export newUnameCollector function in uname.go (#3227)
Signed-off-by: Vitaly Orlov <orloff.v@gmail.com>
2025-01-25 20:52:46 +01:00
Daniel Swarbrick acdd9b813d
arp: optimize netlink interface name resolution (#3133)
github.com/jsimonetti/rtnetlink provides a high level rtnl wrapper
around the lower level rtnetlink functions, which essentially does all
that we need. The rtnl.Conn.Neighbors uses an internal cache for
resolving interface indexes to names, so it makes at most one rtnetlink
call per interface to resolve the name.

Using this high level wrapper hugely simplifies our code and makes it
easier to understand and maintain.

Fixes: #3075

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2025-01-10 10:58:08 +01:00
Xuhui Zhu 8f9a914bee add arm test
Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
2025-01-02 12:56:17 +01:00
Xuhui Zhu 0c1af8dfe0 add test
Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
2025-01-02 12:56:17 +01:00
Xuhui Zhu 89a21a9c4c restruct code
Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
2025-01-02 12:56:17 +01:00
Xuhui Zhu 6f3c345632 add gpu clk
Signed-off-by: Xuhui Zhu <simon.zhu@canonical.com>
2025-01-02 12:56:17 +01:00
Pranshu Srivastava b8aac7c92e collector/cpu: Support CPU online status
Blocked by: https://github.com/prometheus/procfs/pull/644.

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2024-12-23 11:37:39 +01:00
Ben Kochie ff97e35a71 Enable goimports linter
Enable `goimports` golangci-lint linter and fix issues.

Signed-off-by: Ben Kochie <superq@gmail.com>
2024-12-19 14:46:58 +01:00
Ben Kochie 226c80c83c Add filesystem include flags
Add support for allow lists of filesystem mount points and filesystem
types. This allows for less messy regexps when you want to target only
specific lists of mount points or filesystem types.

Signed-off-by: Ben Kochie <superq@gmail.com>
2024-12-14 14:14:54 +01:00
mknapphrt 0fddfd1ba5
Cache metricsfamily help text (#3175)
Signed-off-by: Mark Knapp <mknapp@hudson-trading.com>
2024-11-07 21:46:38 +01:00