Virtio devices don't have ID_SERIAL_SHORT but do have ID_SERIAL.
This change adds a fallback to use ID_SERIAL when ID_SERIAL_SHORT
is not available, allowing serial numbers to be properly exposed
for virtio block devices.
Also updates test expectations to reflect that devices with only
ID_SERIAL (like mmcblk devices in fixtures) now report their serial
numbers instead of empty strings.
Signed-off-by: illustris <rharikrishnan95@gmail.com>
* * Rebase from upstream
* add sriov, power info support and pci id name resolution
Signed-off-by: Jain Johny <jj@asama.ai>
* fix/remove debug lines
Signed-off-by: Jain Johny <jj@asama.ai>
---------
Signed-off-by: Jain Johny <jj@asama.ai>
* add numa_node and missing test output file (#2)
* add numa_node and missing test output file
Signed-off-by: Jain Johny <jj@asama.ai>
* use c.logger for debug line
Signed-off-by: Jain Johny <jj@asama.ai>
* point to procfs master
Signed-off-by: Jain Johny <jj@asama.ai>
* include device_id in e2e-output pecidevice output
Signed-off-by: Jain Johny <jj@asama.ai>
* fix typo in e2e-output.txt
Signed-off-by: Jain Johny <jj@asama.ai>
* update test cases in e2e-64k-page-output.txt
Signed-off-by: Jain Johny <jj@asama.ai>
* fixing the rebase
Signed-off-by: Jain Johny <jj@asama.ai>
* move power_state to enum metric type, dont emit unavailable metrics
Signed-off-by: Jain Johny <jj@asama.ai>
* change test fixtures for power state change
Signed-off-by: Jain Johny <jj@asama.ai>
* change test fixtures for numa_node change
Signed-off-by: Jain Johny <jj@asama.ai>
---------
Signed-off-by: Jain Johny <jj@asama.ai>
* Add /proc/swaps collector
Building on prometheus/procfs#246 this PR is introducing metrics around swap devices.
Today metrics around swap are already available, but they are on the node level.
With this PR, metrics are now available per device.
Relates to: #1890
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
Co-authored-by: claude.ai
---------
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
* chore: Upgrade golangci-lint to v2
- Migrate the configuration file
- Update the tooling version and CI
- Apply auto-fixes
Signed-off-by: Kemal Akkoyun <kemal.akkoyun@datadoghq.com>
* chore: Upgrade golangci-lint to v2
- Migrate the configuration file
- Update the tooling version and CI
- Apply auto-fixes
Signed-off-by: Kemal Akkoyun <kemal.akkoyun@datadoghq.com>
---------
Signed-off-by: Kemal Akkoyun <kemal.akkoyun@datadoghq.com>
* Bump Prometheus client_golang/common/exporter-toolkit libraries.
* Adapt textfile parser to the new validation scheme.
Signed-off-by: Ben Kochie <superq@gmail.com>
* filesystem: take super options into account for read-only
With the latest change implemented to use `mountinfo` instead of
`mounts` there was a regression in filesystem readonly detection
due to super options not taken into account: filesystems that would
previously be marked a "read-only" would not anymore because that
information had moved to super options instead of mount options on
certain occasions.
fixes#3157
Signed-off-by: nicbaz <932244+nicbaz@users.noreply.github.com>
* filesystem: use faster integer to string implementation
Signed-off-by: nicbaz <932244+nicbaz@users.noreply.github.com>
---------
Signed-off-by: nicbaz <932244+nicbaz@users.noreply.github.com>
Use standard lib binary.NativeEndian instead of third-party package.
Supported since Go 1.21.
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
* 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>
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>
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>
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>
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>