From a38cd232199d182838c7e98821d0cde8035a9dbf Mon Sep 17 00:00:00 2001 From: Oleksii <39950859+0leksii@users.noreply.github.com> Date: Fri, 8 Nov 2024 13:06:25 +0200 Subject: [PATCH] PMM-12155 Sync with upstream (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix lint issues Signed-off-by: jalev * Bump perf-utils version to 0.6.0 This change updates the perf-utils library to 0.6.0 which has some fixes for automatically detecting the correct tracefs mountpoint if available. Signed-off-by: Daniel Hodges * Fix thermal_zone collector noise Add a check for missing/unreadable thermal zone stats and ignore if not availlable. Fixes: https://github.com/prometheus/node_exporter/issues/2552 Signed-off-by: Ben Kochie * Update common Prometheus files Signed-off-by: prombot * Enable uname collector on NetBSD too This collector works just fine without any further changes. Signed-off-by: Benny Siegert * build(deps): bump github.com/mdlayher/netlink from 1.7.0 to 1.7.1 Bumps [github.com/mdlayher/netlink](https://github.com/mdlayher/netlink) from 1.7.0 to 1.7.1. - [Release notes](https://github.com/mdlayher/netlink/releases) - [Changelog](https://github.com/mdlayher/netlink/blob/main/CHANGELOG.md) - [Commits](https://github.com/mdlayher/netlink/compare/v1.7.0...v1.7.1) --- updated-dependencies: - dependency-name: github.com/mdlayher/netlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/josharian/native from 1.0.0 to 1.1.0 Bumps [github.com/josharian/native](https://github.com/josharian/native) from 1.0.0 to 1.1.0. - [Release notes](https://github.com/josharian/native/releases) - [Commits](https://github.com/josharian/native/compare/v1.0.0...v1.1.0) --- updated-dependencies: - dependency-name: github.com/josharian/native dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * fix cpustat when some cpus are offline Signed-off-by: Jia Xin * build(deps): bump github.com/prometheus/common from 0.37.0 to 0.39.0 Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.37.0 to 0.39.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.37.0...v0.39.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update e2e output for new common version. Signed-off-by: Ben Kochie * Update common Prometheus files Signed-off-by: prombot * NetBSD support for the meminfo collector This depends on a recent change to golang.org/x/sys that adds a unix.SysctlUvmexp function. Signed-off-by: Benny Siegert * memory_bsd: Fix a problem fetching the user wire count on FreeBSD Signed-off-by: David O'Rourke * Optimize cpufreq collector Move metric descriptiions to package vars to avoid allocating them every time `NewCPUFreqCollector()` is called. Signed-off-by: Ben Kochie * build(deps): bump github.com/hodgesds/perf-utils from 0.6.0 to 0.7.0 Bumps [github.com/hodgesds/perf-utils](https://github.com/hodgesds/perf-utils) from 0.6.0 to 0.7.0. - [Release notes](https://github.com/hodgesds/perf-utils/releases) - [Commits](https://github.com/hodgesds/perf-utils/compare/v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: github.com/hodgesds/perf-utils dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Deprecate ntp collector The ntp collector has always been a source of confusion and problems. The data it produces is more of a blackbox probe against an NTP server. The time sync / offset data produced is not what users expect. Mark this collector as deprecated to be removed in v2.0.0 Signed-off-by: Ben Kochie * Update common Prometheus files Signed-off-by: prombot * build(deps): bump golang.org/x/net from 0.4.0 to 0.7.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](https://github.com/golang/net/compare/v0.4.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] * Remove metrics of offline CPUs in CPU collector Signed-off-by: Haoyu Sun * build(deps): bump github.com/jsimonetti/rtnetlink from 1.3.0 to 1.3.1 Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/opencontainers/selinux Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.10.2 to 1.11.0. - [Release notes](https://github.com/opencontainers/selinux/releases) - [Commits](https://github.com/opencontainers/selinux/compare/v1.10.2...v1.11.0) --- updated-dependencies: - dependency-name: github.com/opencontainers/selinux dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * build(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0 Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.5.0 to 0.6.0. - [Release notes](https://github.com/golang/sys/releases) - [Commits](https://github.com/golang/sys/compare/v0.5.0...v0.6.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update exporter-toolkit * Bump exporter-toolkit to the latest release. * Use new toolkit landing page function. * Update kingpin flags. Signed-off-by: Ben Kochie * Bump exporter-toolkit Pick up the fixes for 32-bit mode and updated HTML template. Signed-off-by: Ben Kochie * Update build * Update Go to 1.20 * Update golangci-lint. * Update CI orb. * Fix staticcheck issue in perf collector. Signed-off-by: Ben Kochie * Allow root path as metrics path. (#2590) Signed-off-by: LamGC * Fix spelling issues Minor typo fixup. Signed-off-by: Ben Kochie * interrupts_linux: Fix fields on aarch64 (#2631) * interrupts_linux: Fix fields on aarch64 Fixes #2557 --------- Signed-off-by: Daniël van Eeden * feat: add support for cpu freq governor metrics Signed-off-by: Lukas Coppens * feat: add support for cpu freq governor metrics Signed-off-by: Lukas Coppens * Reduce priviliges needed for btrfs device stats Signed-off-by: Marcus Cobden * Update common Prometheus files Signed-off-by: prombot * build(deps): bump github.com/safchain/ethtool from 0.2.0 to 0.3.0 Bumps [github.com/safchain/ethtool](https://github.com/safchain/ethtool) from 0.2.0 to 0.3.0. - [Release notes](https://github.com/safchain/ethtool/releases) - [Commits](https://github.com/safchain/ethtool/compare/v0.2.0...v0.3.0) --- updated-dependencies: - dependency-name: github.com/safchain/ethtool dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/prometheus/common from 0.41.0 to 0.42.0 Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.41.0 to 0.42.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.41.0...v0.42.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * NetBSD support for CPU collector (#2626) * Added CPU collector for NetBSD to provide load and temperature statistics --------- Signed-off-by: Matthias Petermann * feat: added suspended as a node_zfs_zpool_state (#2449) Signed-off-by: Pablo Caderno * build(deps): bump github.com/mdlayher/netlink from 1.7.1 to 1.7.2 Bumps [github.com/mdlayher/netlink](https://github.com/mdlayher/netlink) from 1.7.1 to 1.7.2. - [Release notes](https://github.com/mdlayher/netlink/releases) - [Changelog](https://github.com/mdlayher/netlink/blob/main/CHANGELOG.md) - [Commits](https://github.com/mdlayher/netlink/compare/v1.7.1...v1.7.2) --- updated-dependencies: - dependency-name: github.com/mdlayher/netlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.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.14.0...v1.15.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * doc: added undocumented include and exclude flags (#2670) * doc: added undocumented exclude flags Signed-off-by: David Calvert * Expose administrative state of network interfaces as 'adminstate'. (#2515) Signed-off-by: Maximilian Wilhelm * Use go-runit fork, mark collector as deprecated Signed-off-by: Johannes Ziemke * build(deps): bump github.com/jsimonetti/rtnetlink from 1.3.1 to 1.3.2 (#2673) Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.3.1...v1.3.2) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs (node/mixin): fix annotation for Skew alert (#2671) This updates the annotation for the NodeClockSkewDetected mixin alert to match the new threshold set. Original discussion was in this PR: https://github.com/prometheus/node_exporter/pull/1480 I spent an embarrassingly large amount of time trying to figure out how the heck that alert would mean 300s of clock skew. Turns out the annotation was just left the same after the threshold change. Signed-off-by: Will Bollock * collector/netisr_freebsd.go: Added collector for netisr subsystem. (#2668) Signed-off-by: Jonathan Davies * Do not hand define struct clockinfo here. Instead use the version from (#2663) x/sys/unix. The clockinfo struct was altered beginning of 2021 and this code was not adjusted. Signed-off-by: Claudio Jeker * Fix filesystem collector for OpenBSD to not print loads of zero bytes in name (#2637) Use the filesystem collector for all OpenBSD archs, there is no reason to only use it on amd64 systems. Signed-off-by: Claudio Jeker * collector: fix comment and remove redundant parentheses (#2691) Signed-off-by: cui fliter * PMM-12116 Sync with upstream and update dependencies Sync with the latest version of upstream v1.5.0 and update dependencies with reported vulnerabilities. * bcache: remove cache_readaheads_totals metrics #2103 (#2583) * bcache: remove cache_readaheads_totals metrics #2103 Signed-off-by: Saleh Sal <0xack13@gmail.com> * Append bcacheReadaheadMetrics when CacheReadaheads value exists Signed-off-by: Saleh Sal <0xack13@gmail.com> * Update test cases for cachereadahead greater than zero Signed-off-by: Saleh Sal <0xack13@gmail.com> --------- Signed-off-by: Saleh Sal <0xack13@gmail.com> * Fix CVE-2022-41723 by upgrading x/net to v0.10.0 (#2694) Signed-off-by: Nitin Shelke * Update e2e output fixtures (#2696) Fix up correct e2e output for node_power_supply_info. Signed-off-by: Ben Kochie * Update Go modules (#2695) Update Prometheus modules to latest releases. * Add missing fixtures for cpus online/offline. Signed-off-by: Ben Kochie * fix(zfs): add `memory_available_bytes`, fix `dbufstats` filename on Linux (#2687) * Fix zfs memory_available_bytes collector * Fix zfs dbufstats collector --------- Signed-off-by: dongjiang1989 * Update Go module for ema/qdisc (#2700) * Update Go module for ema/qdisc --------- Signed-off-by: jbradleynh * Deprecate supervisord collector Mark the `supervisord` as deprecated. This process supevisor, like `runit`, is of scope for the node_exporter. Signed-off-by: Ben Kochie * collector/diskstats: Use SCSI_IDENT_SERIAL as serial (#2612) On most hard drives, `ID_SERIAL_SHORT` and `SCSI_IDENT_SERIAL` are identical, but on some SAS drives they do differ. In that case, `SCSI_IDENT_SERIAL` corresponds to the serial number printed on the drive label, and to the value returned by `smartctl -i`. So use that value by default for the `serial` label on the `node_disk_info` metric, and fallback to `ID_SERIAL_SHORT` only if it's undefined. Signed-off-by: Benoît Knecht * softnet: additionals metrics from softnet_data, (#2592) * softnet: additionals metrics from softnet_data, https://github.com/prometheus/procfs/pull/473 --------- Signed-off-by: remi Signed-off-by: Rémi Jouannet * exposing softirq metrics (#2294) Signed-off-by: abbeywoodyear * netlink: read missing attributes from sysfs (#2669) Read missing dev_id, name_assign_type, and addr_assign_type from sysfs, since they only take a device-specific lock and not the whole RTNL lock. This means reading them is much less impactful on other system processes than many of the other attributes in sysfs that do take the RTNL lock. Signed-off-by: Dan Williams * Update ansible role in README.md (#2702) https://github.com/cloudalchemy/ansible-node-exporter has been deprecated Signed-off-by: Johannes Dilli * Release v1.6.0 (#2701) * [CHANGE] Fix cpustat when some cpus are offline #2318 * [CHANGE] Remove metrics of offline CPUs in CPU collector #2605 * [CHANGE] Deprecate ntp collector #2603 * [CHANGE] Remove bcache `cache_readaheads_totals` metrics #2583 * [CHANGE] Deprecate supervisord collector #2685 * [FEATURE] Enable uname collector on NetBSD #2559 * [FEATURE] NetBSD support for the meminfo collector #2570 * [FEATURE] NetBSD support for CPU collector #2626 * [FEATURE] Add FreeBSD collector for netisr subsystem #2668 * [FEATURE] Add softirqs collector #2669 * [ENHANCEMENT] Add suspended as a `node_zfs_zpool_state` #2449 * [ENHANCEMENT] Add administrative state of Linux network interfaces #2515 * [ENHANCEMENT] Log current value of GOMAXPROCS #2537 * [ENHANCEMENT] Add profiler options for perf collector #2542 * [ENHANCEMENT] Allow root path as metrics path #2590 * [ENHANCEMENT] Add cpu frequency governor metrics #2569 * [ENHANCEMENT] Add new landing page #2622 * [ENHANCEMENT] Reduce privileges needed for btrfs device stats #2634 * [ENHANCEMENT] Add ZFS `memory_available_bytes` #2687 * [ENHANCEMENT] Use `SCSI_IDENT_SERIAL` as serial in diskstats #2612 * [ENHANCEMENT] Read missing from netlink netclass attributes from sysfs #2669 * [BUGFIX] perf: fixes for automatically detecting the correct tracefs mountpoints #2553 * [BUGFIX] Fix `thermal_zone` collector noise @2554 * [BUGFIX] Fix a problem fetching the user wire count on FreeBSD 2584 * [BUGFIX] interrupts: Fix fields on linux aarch64 #2631 * [BUGFIX] Remove metrics of offline CPUs in CPU collector #2605 * [BUGFIX] Fix OpenBSD filesystem collector string parsing #2637 * [BUGFIX] Fix bad reporting of `node_cpu_seconds_total` in OpenBSD #2663 Signed-off-by: Ben Kochie * build(deps): bump github.com/beevik/ntp from 0.3.0 to 1.0.0 Bumps [github.com/beevik/ntp](https://github.com/beevik/ntp) from 0.3.0 to 1.0.0. - [Release notes](https://github.com/beevik/ntp/releases) - [Changelog](https://github.com/beevik/ntp/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/beevik/ntp/compare/v0.3.0...v1.0.0) --- updated-dependencies: - dependency-name: github.com/beevik/ntp dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/prometheus/procfs from 0.10.0 to 0.10.1 Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.10.0 to 0.10.1. - [Release notes](https://github.com/prometheus/procfs/releases) - [Commits](https://github.com/prometheus/procfs/compare/v0.10.0...v0.10.1) --- updated-dependencies: - dependency-name: github.com/prometheus/procfs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/jsimonetti/rtnetlink from 1.3.2 to 1.3.3 Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.3.2...v1.3.3) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Parallelize stat calls in Linux filesystem collector. This change adds the ability to process multiple stat calls in parallel. Processing is rate-limited based on the new flag `collector.filesystem.stat-workers` (default 4). Caveat: filesystem stats information is no longer in the same order as returned by `/proc/1/mounts`. This should not be an issue. Caveat: This change currently uses unbuffered channels to prove correctness without reliance on buffers. Buffered channels will yield superior performance. Signed-off-by: Erica Mays * fix misspel in CHANGELOG.md (#2717) Signed-off-by: juzhao * Bump wifi Go module (#2719) Update github.com/mdlayher/wifi to the latest commit. Signed-off-by: Ben Kochie * Bump ethtool library (#2720) Update to latest release. Signed-off-by: Ben Kochie * add missing linkspeeds (#2711) Signed-off-by: Cam Cope * Update common Prometheus files (#2723) Signed-off-by: prombot * Update golangci-lint config (#2722) * Migrate from Python codespell to golangci-lint misspell. * Inline errcheck exclude list in the golangci-lint config. Signed-off-by: Ben Kochie * Add mountpoint to NodeFilesystem alerts This helps to identify alerting filesystem. Signed-off-by: Vitaly Zhuravlev * Decrease NodeFilesystem pending time to 15m 30m is too long and there is a risk of running out of disk space/inodes completely if something is filling up disk very fast (like log file). Signed-off-by: Vitaly Zhuravlev * Add CPU and memory alerts Signed-off-by: Vitaly Zhuravlev * Add failed systemd service alert Signed-off-by: Vitaly Zhuravlev * Decrease NodeNetwork*Errs pending period Signed-off-by: Vitaly Zhuravlev * Set 'at' everywhere as preposition for instance Signed-off-by: Vitaly Zhuravlev * Add NodeDiskIOSaturation alert Signed-off-by: Vitaly Zhuravlev * Add %(nodeExporterSelector)s to Network and conntrack alerts Signed-off-by: Vitaly Zhuravlev * Add diskDevice selector Signed-off-by: Vitaly Zhuravlev * Fix NodeMemoryHighUtilization alert Signed-off-by: Vitaly Zhuravlev * Add NodeSystemSaturation and NodeMemoryMajorPagesFaults Signed-off-by: Vitaly Zhuravlev * Decrease NodeSystemdServiceFailed severity to warning Signed-off-by: Vitaly Zhuravlev * Extend alert description Signed-off-by: Vitaly Zhuravlev * Add comma after 'mounted on' Signed-off-by: Vitaly Zhuravlev * Add thresholds for memory alerts Signed-off-by: Vitaly Zhuravlev * Add thresholds for memory, disk and system alerts Signed-off-by: Vitaly Zhuravlev * Set severity to NodeCPUHighUsage to info Signed-off-by: Vitaly Zhuravlev * Update NodeSystemSaturation severity Signed-off-by: Vitaly Zhuravlev * Revert alerts pending durtions Signed-off-by: Vitaly Zhuravlev * Update common Prometheus files Signed-off-by: prombot * Add cpu vulnerabilities reporting from sysfs (#2721) * Add cpu vulnerabilities reporting from sysfs --------- Signed-off-by: Michal Wasilewski * build(deps): bump github.com/beevik/ntp from 1.0.0 to 1.1.1 Bumps [github.com/beevik/ntp](https://github.com/beevik/ntp) from 1.0.0 to 1.1.1. - [Release notes](https://github.com/beevik/ntp/releases) - [Changelog](https://github.com/beevik/ntp/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/beevik/ntp/compare/v1.0.0...v1.1.1) --- updated-dependencies: - dependency-name: github.com/beevik/ntp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.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.15.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Add include and exclude filter for hwmon collector (#2699) * Add include and exclude flags chip name flags to hwmon collector, following example in systemd collector --------- Signed-off-by: Conall O'Brien Co-authored-by: Ben Kochie * Add missing ethtool flag documentation (#2743) Signed-off-by: Gabi Davar * Update all Include and Exclude variables to use the systemdUnit naming (#2740) prefix. Leave an annotation about using regexps instead of device_filter.go, so @SuperQ doesn't need to remember everything. Signed-off-by: Conall O'Brien * Fixup hwmon chip include (#2739) Use the correct include value to the device filter function. * Add new bogus hwmon fixture. * Update end-to-end test to use hwmon chip include flag. Signed-off-by: Ben Kochie * Release v1.6.1 (#2747) Rebuild with latest Go compiler bugfix release. Signed-off-by: Ben Kochie * Synchronize common files from prometheus/prometheus (#2736) * Update common Prometheus files Signed-off-by: prombot * Fixup linting issues * Disbale unused-parameter check. * Fixup minor linting issues. Signed-off-by: Ben Kochie --------- Signed-off-by: prombot Signed-off-by: Ben Kochie Co-authored-by: Ben Kochie * Update common Prometheus files (#2752) Signed-off-by: prombot * Include drm collector in README The DRM collector was missing in the README, this change includes it together with a short description. Signed-off-by: L <3177243+LukeLR@users.noreply.github.com> * collector/netdev_linux.go: Fallback to 32-bit stats (#2757) On some platforms, `msg.Attributes.Stats64` is `nil` because the kernel doesn't expose 64-bit stats. In that case, return `msg.Attributes.Stats` instead, which are the 32-bit equivalent. Note that `RXOtherhostDropped` isn't available in that case, so we hardcode it to zero. Fixes #2756. Signed-off-by: Benoît Knecht * build(deps): bump github.com/beevik/ntp from 1.1.1 to 1.3.0 (#2762) Signed-off-by: Ben Kochie * build(deps): bump github.com/prometheus/procfs from 0.11.0 to 0.11.1 (#2763) Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.11.0 to 0.11.1. - [Release notes](https://github.com/prometheus/procfs/releases) - [Commits](https://github.com/prometheus/procfs/compare/v0.11.0...v0.11.1) --- updated-dependencies: - dependency-name: github.com/prometheus/procfs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/jsimonetti/rtnetlink from 1.3.3 to 1.3.4 (#2765) Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.3.3...v1.3.4) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Drop redundant GOOS build tags if already in filename Drop redundant GOOS build tags at start of file if the constraint is already specified by the filename, e.g. foo_GOOS.go or foo_GOOS_GOARCH.go, avoiding potential confusion in future. cf. https://pkg.go.dev/cmd/go#hdr-Build_constraints Signed-off-by: Daniel Swarbrick * Sync build tags in *_test.go (#2767) Ensure that unwanted tests are correctly excluded when various build tags are specified, i.e. when the code that they test would be excluded from compilation. Signed-off-by: Daniel Swarbrick * Upgrade github.com/ema/qdisc to v1.0.0 to improve qdisc collector (#2779) performance Signed-off-by: Oliver Geiselhardt-Herms Co-authored-by: Oliver Geiselhardt-Herms * Add CPU MHz as the value for "node_cpu_info" metric For CPUs which don't have an available (or insertable) cpufreq driver, the /proc/cpuinfo file can sometimes have accurate CPU core frequency measurements. This change replaces the constant value of "1" for the "node_cpu_info" metric with the parsed CPU MHz value from /proc/cpuinfo for each core. Signed-off-by: John Kordich * Update e2e-output.txt with new expected metric values Changes the e2e-output.txt file to have the expected CPU MHz values for the node_cpu_info metric. Signed-off-by: John Kordich * Add new node_cpu_frequency_hertz metric Revert changes to node_cpu_info and add new node_cpu_frequency_hertz metric for measuring CPU frequency from /proc/cpuinfo Signed-off-by: John Kordich * Change log message from Warn to Debug Signed-off-by: John Kordich Co-authored-by: Ben Kochie Signed-off-by: John Kordich * fix(qdisc) flag naming corrected for consistency (#2782) * fix collector qdisc flag naming for consistency --------- Signed-off-by: jbradleynh * btrfs: close btrfs.FS handle after use Despite being quite hard to provoke (< 10% in my testing), the btrfs collector would occasionally leave stale FDs relating to btrfs mountpoints, making the filesystems unable to be unmounted. Fixes: #2772. Signed-off-by: Daniel Swarbrick * Update to Go 1.21 (#2796) * Update Go build to 1.21. * Update machine images to Ubuntu 22.04 current. Signed-off-by: Ben Kochie * Optionally fetch ARP stats via rtnetlink instead of procfs (#2777) * Optionally fetch ARP stats via rtnetlink instead of procfs Implement collection of ARP stats via rtnetlink to work around shortcomings in the output of /proc/net/arp, which truncates InfiniBand link-layer addresses. Fixes: #2776 --------- Signed-off-by: Daniel Swarbrick Co-authored-by: Ben Kochie * build(deps): bump golang.org/x/sys from 0.10.0 to 0.12.0 (#2797) Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.10.0 to 0.12.0. - [Commits](https://github.com/golang/sys/compare/v0.10.0...v0.12.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update common Prometheus files (#2798) Signed-off-by: prombot * Add ZFS freebsd per dataset stats (#2753) * Rename parsePoolObjsetFile to parseLinuxPoolObjsetFile to better reflect it's scope * Create a new parseFreeBSDPoolObjsetStats function, to generate a list of per pool metrics to be queried via sysctl --------- Signed-off-by: Conall O'Brien * Move RO status before error return Signed-off-by: Metbog * Update common Prometheus files Signed-off-by: prombot * fix(zfs) zfs `arcstats.p` on FreeBSD 14.0+ (#2754) * dongjiang, fix zfs arcstats.p Signed-off-by: dongjiang1989 * dongjiang, fix gofmt -s Signed-off-by: dongjiang1989 * change warn log to debug log by code review Signed-off-by: dongjiang1989 --------- Signed-off-by: dongjiang1989 * Fix promhttp_metric_handler_errors_total metric not being disabled by flag Signed-off-by: ToMe25 * build(deps): bump github.com/prometheus/client_golang (#2815) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.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.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix inconsistent variable name, to address compilation issue (#2820) https://github.com/prometheus/node_exporter/issues/2819 Signed-off-by: Conall O'Brien * Update README.md: update the 'more details' url in the section 'TLS endpoint' (#2814) * Update README.md: correct the wrong url(link to exporter-toolkit web-config) in the section 'TLS endpoint' Signed-off-by: yang-stressfree <68363665+yang-stressfree@users.noreply.github.com> * Update README.md Co-authored-by: Ben Kochie Signed-off-by: yang-stressfree <68363665+yang-stressfree@users.noreply.github.com> --------- Signed-off-by: yang-stressfree <68363665+yang-stressfree@users.noreply.github.com> Co-authored-by: Ben Kochie * Update common Prometheus files Signed-off-by: prombot * build(deps): bump golang.org/x/net from 0.11.0 to 0.17.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.11.0 to 0.17.0. - [Commits](https://github.com/golang/net/compare/v0.11.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] * build(deps): bump github.com/prometheus/procfs from 0.11.1 to 0.12.0 Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.11.1 to 0.12.0. - [Release notes](https://github.com/prometheus/procfs/releases) - [Commits](https://github.com/prometheus/procfs/compare/v0.11.1...v0.12.0) --- updated-dependencies: - dependency-name: github.com/prometheus/procfs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update e2e fixtures Update for fixes in https://github.com/prometheus/procfs/pull/543 Signed-off-by: Ben Kochie * NFSd: fix nfsd v4 index miss (#2824) * fix nfsd v4 index miss --------- Signed-off-by: dongjiang1989 * fix readme about expose memory statistics Signed-off-by: joey * Fix typo in CHANGELOG.md (#2836) Use # consistently for PR number. Signed-off-by: nemobis * Update common Prometheus files (#2840) Signed-off-by: prombot * build(deps): bump github.com/prometheus/common from 0.44.0 to 0.45.0 (#2837) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.44.0 to 0.45.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.44.0...v0.45.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/prometheus/client_model (#2838) Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.4.1-0.20230718164431-9a2bf3000d16 to 0.5.0. - [Release notes](https://github.com/prometheus/client_model/releases) - [Commits](https://github.com/prometheus/client_model/commits/v0.5.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_model dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Release 1.7.0 (#2845) * [FEATURE] Add ZFS freebsd per dataset stats #2753 * [FEATURE] Add cpu vulnerabilities reporting from sysfs #2721 * [ENHANCEMENT] Parallelize stat calls in Linux filesystem collector #1772 * [ENHANCEMENT] Add missing linkspeeds to ethtool collector 2711 * [ENHANCEMENT] Add CPU MHz as the value for `node_cpu_info` metric #2778 * [ENHANCEMENT] Improve qdisc collector performance #2779 * [ENHANCEMENT] Add include and exclude filter for hwmon collector #2699 * [ENHANCEMENT] Optionally fetch ARP stats via rtnetlink instead of procfs #2777 * [BUFFIX] Fix ZFS arcstats on FreeBSD 14.0+ 2754 * [BUGFIX] Fallback to 32-bit stats in netdev #2757 * [BUGFIX] Close btrfs.FS handle after use #2780 * [BUGFIX] Move RO status before error return #2807 * [BUFFIX] Fix `promhttp_metric_handler_errors_total` being always active #2808 * [BUGFIX] Fix nfsd v4 index miss #2824 Signed-off-by: Ben Kochie * Add NodeBondingDegraded alert (#2843) Signed-off-by: Ayoub Nasr * Make filesystem space prediction window configurable (#2844) Signed-off-by: fitz123 * NFSd: handle new wdeleg_getattr attribute in /proc/net/rpc/nfsd (#2810) This attribute was introduced it v6.6-rc1. The relevant changes in procfs were merged here: https://github.com/prometheus/procfs/pull/574 and are part of procfs v0.11.2 I have also figured out that the stat should be part of the v4 ops counters struct, but that will need changes to both procfs and this code. Since people are already using 6.6-rc1, I think it's better to get the code out there --- even if they don't care about wdeleg_getattr, currently they get _no_ nfsd stats with 6.6-rc1. I will make two follow-up PRs to clean this up in the next releases of procfs and node-exporter. Signed-off-by: Tobias Klausmann * Update common Prometheus files (#2851) Signed-off-by: prombot * Update containerization warnings (#2855) Running node_exporter in containers is now a fairly well understood problem. Replace the warnings with something less dire and more prescriptive. Signed-off-by: Ben Kochie * Fix debug log in cpu collector (#2857) Signed-off-by: Simon Pasquier * build(deps): bump github.com/alecthomas/kingpin/v2 from 2.3.2 to 2.4.0 (#2865) Bumps [github.com/alecthomas/kingpin/v2](https://github.com/alecthomas/kingpin) from 2.3.2 to 2.4.0. - [Release notes](https://github.com/alecthomas/kingpin/releases) - [Commits](https://github.com/alecthomas/kingpin/compare/v2.3.2...v2.4.0) --- updated-dependencies: - dependency-name: github.com/alecthomas/kingpin/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump howett.net/plist from 1.0.0 to 1.0.1 (#2862) Bumps [howett.net/plist](https://github.com/DHowett/go-plist) from 1.0.0 to 1.0.1. - [Commits](https://github.com/DHowett/go-plist/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: howett.net/plist dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add new collector and metrics for XFRM (#2544) (#2866) Signed-off-by: Gavin Lam * build(deps): bump github.com/jsimonetti/rtnetlink from 1.3.5 to 1.4.0 (#2864) Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.3.5 to 1.4.0. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.3.5...v1.4.0) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump golang.org/x/sys from 0.13.0 to 0.15.0 (#2863) Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.13.0 to 0.15.0. - [Commits](https://github.com/golang/sys/compare/v0.13.0...v0.15.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add TCPOFOQueue to default netstat metrics (#2867) Adds a count for TCP packets received out of orders. This can be an indication that there is packet loss on the way packets travel towards this server. In that case, the sender will retransmit (and we can already monitor the Tcp_RetransSegs there), but we have no way to monitor the packet loss on the receiver side. When a packet is received and the receiver detects previous one missing, it will increase the TCPOFOQueue counter and reply with selective ACK to the sender, both possible indications of packet loss. Confirmation of packet loss can be achieved by taking packet captures, ignoring wireshark analysis, and carefully looking at data being retransmitted based on the TCP seq. Just like RetransSegs, TCPOFOQueue should be interesting for any deployment as a mean to detect packet loss, so here suggesting adding it to the default list. Signed-off-by: François Rigault Co-authored-by: François Rigault * Update common Prometheus files (#2870) Signed-off-by: prombot * Add mitigation information to the linux vulnerabilities collector (#2806) While the CPU vulnerabilities collector has been added in https://github.com/prometheus/node_exporter/pull/2721 , it's currently not including information regarding the mitigation strategy used for a given vulnerability. This information can be quite valuable, as often times different mitigation strategies come with a different performance impact. This commit adds a third label to the cpu_vulnerabilities_info metric, to include the "mitigation" used for a given vulnerability - if a given vulnerability is not affecting a node or the node is still vulnerable, the mitigation is expected to be empty. Signed-off-by: João Lima * Update common Prometheus files (#2872) Signed-off-by: prombot * build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#2877) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0. - [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update common Prometheus files (#2879) Signed-off-by: prombot * build(deps): bump github.com/prometheus/exporter-toolkit (#2885) Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Changelog](https://github.com/prometheus/exporter-toolkit/blob/master/CHANGELOG.md) - [Commits](https://github.com/prometheus/exporter-toolkit/compare/v0.10.0...v0.11.0) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/beevik/ntp from 1.3.0 to 1.3.1 (#2886) Bumps [github.com/beevik/ntp](https://github.com/beevik/ntp) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/beevik/ntp/releases) - [Changelog](https://github.com/beevik/ntp/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/beevik/ntp/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: github.com/beevik/ntp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/prometheus/client_golang (#2887) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.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.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update common Prometheus files (#2897) Signed-off-by: prombot * diskstats: ignore zram devices on linux systems by default (#2898) Signed-off-by: DBS-ST-VIT Co-authored-by: DBS-ST-VIT * Bump golang-builder version (#2908) Signed-off-by: Alper Polat * exec_bsd: Fix labels for vm.stats.sys.v_syscall sysctl (#2895) Signed-off-by: David O'Rourke * chore:remove constant from function (#2884) Signed-off-by: tyltr * build(deps): bump github.com/prometheus/common from 0.45.0 to 0.46.0 (#2910) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.45.0 to 0.46.0. - [Release notes](https://github.com/prometheus/common/releases) - [Commits](https://github.com/prometheus/common/compare/v0.45.0...v0.46.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/jsimonetti/rtnetlink from 1.4.0 to 1.4.1 (#2909) Bumps [github.com/jsimonetti/rtnetlink](https://github.com/jsimonetti/rtnetlink) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](https://github.com/jsimonetti/rtnetlink/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix hwmon nil ptr (#2873) * fix hwmon nil ptr syslink maybe lost in some cases. --------- Signed-off-by: TaoGe <6657718+yowenter@users.noreply.github.com> * Fix hwmon error capture (#2915) Fix golangci-lint "ineffectual assignment" by correctly capturing any errors within the hwmon gathering loop. Signed-off-by: Ben Kochie * Update common Prometheus files (#2917) Signed-off-by: prombot * Revert "Add ZFS freebsd per dataset stats (#2753)" (#2925) This reverts commit f34aaa61092fe7e3c6618fdb0b0d16a68a291ff7. Signed-off-by: Caleb Webber * filesystem: fix mountTimeout not working issue (#2903) Signed-off-by: DongWei * Fix description for NodeDiskIOSaturation alert (#2929) NodeDiskIOSaturation description should say 30m per the "for" clause Signed-off-by: Taylor Sly * Enforce no subprocess policy (#2926) Add depguard to golangci-lint to enforce the no-os/exec policy. Signed-off-by: Ben Kochie * filesystem: surface device errors (#2923) filesystem: surface filesystem device error Fixes: #2918 --------- Signed-off-by: Pamela Mei i540369 * Revert "filesystem: fix mountTimeout not working issue (#2903)" (#2932) This reverts commit 9f1f791ac2e1377781c4f8807a23d86d92ad6499. Signed-off-by: Ben Kochie * Update common Prometheus files (#2939) Signed-off-by: prombot * Update common Prometheus files (#2946) Signed-off-by: prombot * build(deps): bump golang.org/x/sys from 0.16.0 to 0.17.0 (#2943) Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.16.0 to 0.17.0. - [Commits](https://github.com/golang/sys/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/prometheus/client_golang (#2942) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.18.0 to 1.19.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/v1.19.0/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.18.0...v1.19.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/prometheus/client_model from 0.5.0 to 0.6.0 (#2944) Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.5.0 to 0.6.0. - [Release notes](https://github.com/prometheus/client_model/releases) - [Commits](https://github.com/prometheus/client_model/compare/v0.5.0...v0.6.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_model dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump golang.org/x/sys from 0.17.0 to 0.18.0 (#2948) Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.17.0 to 0.18.0. - [Commits](https://github.com/golang/sys/compare/v0.17.0...v0.18.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update common Prometheus files (#2949) Signed-off-by: prombot * build(deps): bump github.com/prometheus/procfs from 0.12.0 to 0.13.0 (#2952) Bumps [github.com/prometheus/procfs](https://github.com/prometheus/procfs) from 0.12.0 to 0.13.0. - [Release notes](https://github.com/prometheus/procfs/releases) - [Commits](https://github.com/prometheus/procfs/compare/v0.12.0...v0.13.0) --- updated-dependencies: - dependency-name: github.com/prometheus/procfs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add multi-cluster support for Nodes dashboard (#2945) Signed-off-by: Adrian Berger * disable selinux,fix end-to-end-test.sh error(#2934) (#2937) Signed-off-by: heyitao Co-authored-by: heyitao * Add new collector and metrics for watchdog (#2309) (#2880) Signed-off-by: Gavin Lam * Enable watchdog module by default; Add no data error (#2953) Signed-off-by: Gavin Lam * Update common Prometheus files (#2954) Signed-off-by: prombot * build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 (#2955) Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update common Prometheus files (#2959) Signed-off-by: prombot * Update common Prometheus files (#2964) Signed-off-by: prombot * Sanitize ethtool metric name keys Apply the same metric name sanitization to the keys as to the metric names. This avoids conflicting help strings in the metric registry. Fixes: https://github.com/prometheus/node_exporter/issues/2893 Signed-off-by: Ben Kochie * Update common Prometheus files Signed-off-by: prombot * chore: fix some typos (#2974) Signed-off-by: occupyhabit * collector/textfile: Avoid inconsistent help-texts (#2962) Avoid metrics with inconsistent help-texts. The earlier behaviour has been preserved in the sense that the first encountered instance is still used to generate metrics, whereas the subsequent inconsistent ones are ignored along with a few peripheral changes. ``` # HELP node_scrape_collector_duration_seconds node_exporter: Duration of a collector scrape. #TYPE node_scrape_collector_duration_seconds gauge node_scrape_collector_duration_seconds{collector="textfile"} 0.0004005 # HELP node_scrape_collector_success node_exporter: Whether a collector succeeded. # TYPE node_scrape_collector_success gauge node_scrape_collector_success{collector="textfile"} 1 # HELP node_textfile_mtime_seconds Unixtime mtime of textfiles successfully read. # TYPE node_textfile_mtime_seconds gauge node_textfile_mtime_seconds{file="/Users/rexagod/repositories/misc/node_exporter/ne-bar.prom"} 1.710812009e+09 node_textfile_mtime_seconds{file="/Users/rexagod/repositories/misc/node_exporter/ne-foo.prom"} 1.710811982e+09 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge node_textfile_scrape_error 1 # HELP promhttp_metric_handler_errors_total Total number of internal errors encountered by the promhttp metric handler. # TYPE promhttp_metric_handler_errors_total counter promhttp_metric_handler_errors_total{cause="encoding"} 0 promhttp_metric_handler_errors_total{cause="gathering"} 0 # HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served. # TYPE promhttp_metric_handler_requests_in_flight gauge promhttp_metric_handler_requests_in_flight 1 # HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code. # TYPE promhttp_metric_handler_requests_total counter promhttp_metric_handler_requests_total{code="200"} 0 promhttp_metric_handler_requests_total{code="500"} 0 promhttp_metric_handler_requests_total{code="503"} 0 # HELP tau_infrastructure_performing_maintenance_task At what timestamp a given task started or stopped, the last time it was run. # TYPE tau_infrastructure_performing_maintenance_task gauge tau_infrastructure_performing_maintenance_task{main_task="nightly",start_or_stop="start",sub_task="main"} 1.64728080198446e+09 ``` Fixes: #2317 Signed-off-by: Pranshu Srivastava * Update common Prometheus files (#2973) Signed-off-by: prombot * os_release.go: Added support end parsing support. (#2982) * os_release.go: Added support end parsing support. Fixes: #2977 Signed-off-by: Jonathan Davies * os_release_test.go: Added TestParseOSSupportEnd. Signed-off-by: Jonathan Davies --------- Signed-off-by: Jonathan Davies * zfs: Log mib when sysctl read fails on FreeBSD When the zfs collector fails on FreeBSD it doesn't log which `mib` triggered the issue. This makes diagnostics hard. Incompatibilities in the list of supported mibs is not uncommon with major os updates. By adding this change, it'll be easier for users to report the specific mib that is triggering the failure. Related to #2847 Signed-off-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com> * chore: fix typo in comment Signed-off-by: looklose * fibre_channel: update procfs to take into account optional attributes (#2933) Signed-off-by: machine424 * refactor: Optimize code by using built-in constants in the standard library (#2989) Signed-off-by: coderwander <770732124@qq.com> * os_release.go: Removed caching of modtime/filename of os-release file. (#2987) Signed-off-by: Jonathan Davies * build(deps): bump golang.org/x/net from 0.20.0 to 0.23.0 (#2996) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.20.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.20.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: data race of NetClassCollector metrics initialization when multiple requests happen (#2995) Signed-off-by: John Guo * Update common Prometheus files (#2992) Signed-off-by: prombot * Update build (#3000) * Update Go to 1.22. * Update Go modules. * Use new version collector. * Use standard library slices package. Signed-off-by: Ben Kochie * Fix watchdog_test lint and test failures on macos. (#3003) Ensure identical build flags embedded in both files. Signed-off-by: Chris Cleeland * Release v1.8.0 (#3002) * [CHANGE] exec_bsd: Fix labels for `vm.stats.sys.v_syscall` sysctl #2895 * [CHANGE] diskstats: Ignore zram devices on linux systems #2898 * [CHANGE] textfile: Avoid inconsistent help-texts #2962 * [CHANGE] os: Removed caching of modtime/filename of os-release file #2987 * [FEATURE] xfrm: Add new collector #2866 * [FEATURE] watchdog: Add new collector #2880 * [ENHANCEMENT] cpu_vulnerabilities: Add mitigation information label #2806 * [ENHANCEMENT] nfsd: Handle new `wdeleg_getattr` attribute #2810 * [ENHANCEMENT] netstat: Add TCPOFOQueue to default netstat metrics #2867 * [ENHANCEMENT] filesystem: surface device errors #2923 * [ENHANCEMENT] os: Add support end parsing #2982 * [ENHANCEMENT] zfs: Log mib when sysctl read fails on FreeBSD #2975 * [ENHANCEMENT] fibre_channel: update procfs to take into account optional attributes #2933 * [BUGFIX] cpu: Fix debug log in cpu collector #2857 * [BUGFIX] hwmon: Fix hwmon nil ptr #2873 * [BUGFIX] hwmon: Fix hwmon error capture #2915 * [BUGFIX] zfs: Revert "Add ZFS freebsd per dataset stats #2925 * [BUGFIX] ethtool: Sanitize ethtool metric name keys #2940 * [BUGFIX] fix: data race of NetClassCollector metrics initialization #2995 Signed-off-by: Ben Kochie * Update common Prometheus files (#3009) Signed-off-by: prombot * Sign node exporter darwin binary with rcodesign (#3008) * Sign node exporter darwin binary with rcodesign Prevents SIGKILL issues on macs Signed-off-by: Alper Polat * Be explicit about checking for the binary Co-authored-by: Ben Kochie Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com> * Also attempt to sign darwin-amd64 Signed-off-by: Alper Polat --------- Signed-off-by: Alper Polat Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com> Co-authored-by: Ben Kochie * collector/cpu: s/cpu_ticks*/cpu_nsec* for solaris (#2963) Replace all cpu_ticks_* with cpu_nsec_*, since the former was off my a magnitude of 10e6, and showed incorrect values for node_cpu_seconds_total. Fixes: #1837 Signed-off-by: Pranshu Srivastava * Fix pressure collector nil reference (#3016) Check that the PSI metrics are returned in order to avoid nil pointer dereference. * Update fixutre to match real-world samples. Fixes: https://github.com/prometheus/node_exporter/issues/3015 Signed-off-by: Ben Kochie * Release v1.8.1 (#3018) * [BUGFIX] Fix CPU seconds on Solaris #2963 * [BUGFIX] Sign Darwin/MacOS binaries #3008 * [BUGFIX] Fix pressure collector nil reference #3016 Signed-off-by: Ben Kochie * Release v1.8.2 (#3055) * fix pressure metric collection fails on systems that do not expose a full CPU stat #3051 (#3054) Signed-off-by: joey Signed-off-by: Ben Kochie * Release v1.8.2 * [BUGFIX] Fix CPU pressure metric collection #3054 Signed-off-by: Ben Kochie --------- Signed-off-by: joey Signed-off-by: Ben Kochie Co-authored-by: chengjoey <30427474+chengjoey@users.noreply.github.com> * PMM-7 update imports * PMM-12116 update imports * PMM-12116 fix build * PMM-12116 fix CI * PMM-12116 fix linter. * PMM-12116 fix go mod. --------- Signed-off-by: jalev Signed-off-by: Daniel Hodges Signed-off-by: Ben Kochie Signed-off-by: prombot Signed-off-by: Benny Siegert Signed-off-by: dependabot[bot] Signed-off-by: Jia Xin Signed-off-by: David O'Rourke Signed-off-by: Haoyu Sun Signed-off-by: LamGC Signed-off-by: Daniël van Eeden Signed-off-by: Lukas Coppens Signed-off-by: Marcus Cobden Signed-off-by: Matthias Petermann Signed-off-by: Pablo Caderno Signed-off-by: David Calvert Signed-off-by: Maximilian Wilhelm Signed-off-by: Johannes Ziemke Signed-off-by: Will Bollock Signed-off-by: Jonathan Davies Signed-off-by: Claudio Jeker Signed-off-by: cui fliter Signed-off-by: Saleh Sal <0xack13@gmail.com> Signed-off-by: Nitin Shelke Signed-off-by: dongjiang1989 Signed-off-by: jbradleynh Signed-off-by: Benoît Knecht Signed-off-by: remi Signed-off-by: Rémi Jouannet Signed-off-by: abbeywoodyear Signed-off-by: Dan Williams Signed-off-by: Johannes Dilli Signed-off-by: Erica Mays Signed-off-by: juzhao Signed-off-by: Cam Cope Signed-off-by: Vitaly Zhuravlev Signed-off-by: Michal Wasilewski Signed-off-by: Conall O'Brien Signed-off-by: Gabi Davar Signed-off-by: L <3177243+LukeLR@users.noreply.github.com> Signed-off-by: Daniel Swarbrick Signed-off-by: Oliver Geiselhardt-Herms Signed-off-by: John Kordich Signed-off-by: Metbog Signed-off-by: ToMe25 Signed-off-by: yang-stressfree <68363665+yang-stressfree@users.noreply.github.com> Signed-off-by: joey Signed-off-by: nemobis Signed-off-by: Ayoub Nasr Signed-off-by: fitz123 Signed-off-by: Tobias Klausmann Signed-off-by: Simon Pasquier Signed-off-by: Gavin Lam Signed-off-by: François Rigault Signed-off-by: João Lima Signed-off-by: DBS-ST-VIT Signed-off-by: Alper Polat Signed-off-by: tyltr Signed-off-by: TaoGe <6657718+yowenter@users.noreply.github.com> Signed-off-by: Caleb Webber Signed-off-by: DongWei Signed-off-by: Taylor Sly Signed-off-by: Pamela Mei i540369 Signed-off-by: Adrian Berger Signed-off-by: heyitao Signed-off-by: occupyhabit Signed-off-by: Pranshu Srivastava Signed-off-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com> Signed-off-by: looklose Signed-off-by: machine424 Signed-off-by: coderwander <770732124@qq.com> Signed-off-by: John Guo Signed-off-by: Chris Cleeland Signed-off-by: Alper Polat <101826653+gitperr@users.noreply.github.com> Co-authored-by: jalev Co-authored-by: Daniel Hodges Co-authored-by: Ben Kochie Co-authored-by: prombot Co-authored-by: Benny Siegert Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jia Xin Co-authored-by: David O'Rourke Co-authored-by: Haoyu Sun Co-authored-by: LamGC Co-authored-by: Daniël van Eeden Co-authored-by: Lukas Coppens Co-authored-by: Marcus Cobden Co-authored-by: Matthias Petermann <37493510+MatthiasPetermann@users.noreply.github.com> Co-authored-by: Pablo Caderno Co-authored-by: David Calvert Co-authored-by: Maximilian Wilhelm Co-authored-by: Johannes Ziemke Co-authored-by: Will Bollock Co-authored-by: Jonathan Davies Co-authored-by: Claudio Jeker Co-authored-by: cui fliter Co-authored-by: Sal Sal Co-authored-by: Nitin Shelke <58942444+nshelke777@users.noreply.github.com> Co-authored-by: dongjiang Co-authored-by: Josh Bradley <49180168+jbradleynh@users.noreply.github.com> Co-authored-by: Benoît Knecht Co-authored-by: Remi Jouannet Co-authored-by: Abbey Woodyear <81559466+abbeywoodyear@users.noreply.github.com> Co-authored-by: Dan Williams Co-authored-by: Johannes Dilli Co-authored-by: Erica Mays Co-authored-by: Junqi Zhao Co-authored-by: Cam Cope Co-authored-by: Vitaly Zhuravlev Co-authored-by: Vitaly Zhuravlev Co-authored-by: Michal Co-authored-by: Conall O'Brien Co-authored-by: Gabi Davar Co-authored-by: L <3177243+LukeLR@users.noreply.github.com> Co-authored-by: Daniel Swarbrick Co-authored-by: takt Co-authored-by: Oliver Geiselhardt-Herms Co-authored-by: John Kordich Co-authored-by: Metbog Co-authored-by: ToMe25 Co-authored-by: yang-stressfree <68363665+yang-stressfree@users.noreply.github.com> Co-authored-by: joey Co-authored-by: nemobis Co-authored-by: Ayoub NASR Co-authored-by: Anton Lugovoi Co-authored-by: Tobias Klausmann Co-authored-by: Simon Pasquier Co-authored-by: Gavin Lam Co-authored-by: frigo Co-authored-by: François Rigault Co-authored-by: João Pedro Lima Co-authored-by: DBS-ST-VIT <142572752+DBS-ST-VIT@users.noreply.github.com> Co-authored-by: DBS-ST-VIT Co-authored-by: Alper Polat <101826653+gitperr@users.noreply.github.com> Co-authored-by: David O'Rourke Co-authored-by: tyltr Co-authored-by: TaoGe <6657718+yowenter@users.noreply.github.com> Co-authored-by: Caleb Webber Co-authored-by: DongWei Co-authored-by: Taylor Sly Co-authored-by: Pamela Mei <126221706+PamelaMei-SAP@users.noreply.github.com> Co-authored-by: Adrian Berger <43774417+adberger@users.noreply.github.com> Co-authored-by: linuxgcc Co-authored-by: heyitao Co-authored-by: occupyhabit <164632559+occupyhabit@users.noreply.github.com> Co-authored-by: Pranshu Srivastava Co-authored-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com> Co-authored-by: looklose Co-authored-by: Ayoub Mrini Co-authored-by: coderwander <166724773+coderwander@users.noreply.github.com> Co-authored-by: John Guo Co-authored-by: Chris Cleeland Co-authored-by: Pranshu Srivastava Co-authored-by: chengjoey <30427474+chengjoey@users.noreply.github.com> Co-authored-by: Nurlan Moldomurov Co-authored-by: Nurlan Moldomurov --- .circleci/config.yml | 35 +- .github/ISSUE_TEMPLATE.md | 4 +- .github/workflows/container_description.yml | 52 ++ .github/workflows/golangci-lint.yml | 20 +- .github/workflows/main.yml | 7 - .gitignore | 1 + .golangci.yml | 22 +- .promu-cgo.yml | 3 +- .promu.yml | 3 +- .yamllint | 9 +- CHANGELOG.md | 119 +++- Makefile | 9 +- Makefile.common | 40 +- README.md | 65 ++- VERSION | 2 +- collector/arp_linux.go | 100 ++-- collector/bcache_linux.go | 23 +- collector/bonding_linux_test.go | 3 + collector/boot_time_solaris.go | 4 +- collector/btrfs_linux.go | 11 +- collector/collector.go | 48 +- collector/collectorPerconaExtensions.go | 4 +- collector/cpu_linux.go | 113 ++-- collector/cpu_linux_test.go | 198 +++++-- collector/cpu_netbsd.go | 277 +++++++++ collector/cpu_netbsd_test.go | 44 ++ collector/cpu_openbsd.go | 12 +- collector/cpu_solaris.go | 14 +- collector/cpu_vulnerabilities_linux.go | 69 +++ collector/cpufreq_common.go | 59 ++ collector/cpufreq_linux.go | 72 +-- collector/cpufreq_solaris.go | 22 +- collector/device_filter.go | 6 +- collector/diskstats_common.go | 21 +- collector/diskstats_linux.go | 13 +- collector/diskstats_linux_test.go | 5 +- collector/diskstats_openbsd.go | 4 +- collector/ethtool_linux.go | 114 +++- collector/ethtool_linux_test.go | 3 + collector/fibrechannel_linux.go | 16 +- collector/filefd_linux_test.go | 3 + collector/filesystem_bsd.go | 4 +- collector/filesystem_common.go | 27 +- collector/filesystem_linux.go | 157 ++++-- collector/filesystem_linux_test.go | 7 +- ...openbsd_amd64.go => filesystem_openbsd.go} | 10 +- collector/fixtures/e2e-64k-page-output.txt | 409 ++++++++++---- collector/fixtures/e2e-output.txt | 409 ++++++++++---- collector/fixtures/proc/interrupts_aarch64 | 61 ++ collector/fixtures/proc/net/netstat | 4 +- collector/fixtures/proc/net/rpc/nfsd | 1 + collector/fixtures/proc/net/xfrm_stat | 28 + collector/fixtures/proc/pressure/cpu | 1 + collector/fixtures/proc/softirqs | 11 + .../spl/kstat/zfs/{dbuf_stats => dbufstats} | 0 .../fixtures/proc/spl/kstat/zfs/pool2/state | 1 + collector/fixtures/sys.ttar | 250 ++++++++- .../textfile/metrics_merge_different_help.out | 2 +- collector/fixtures/udev.ttar | 529 ++++++++++++++++++ collector/fixtures/udev/data/b11:0 | 38 -- collector/fixtures/udev/data/b179:0 | 13 - collector/fixtures/udev/data/b179:1 | 30 - collector/fixtures/udev/data/b179:2 | 30 - collector/fixtures/udev/data/b252:0 | 20 - collector/fixtures/udev/data/b252:1 | 24 - collector/fixtures/udev/data/b252:2 | 24 - collector/fixtures/udev/data/b252:3 | 24 - collector/fixtures/udev/data/b252:4 | 24 - collector/fixtures/udev/data/b252:5 | 24 - collector/fixtures/udev/data/b254:0 | 10 - collector/fixtures/udev/data/b259:0 | 17 - collector/fixtures/udev/data/b8:0 | 60 -- collector/fixtures/udev/data/b8:16 | 62 -- collector/fixtures/udev/data/b8:32 | 62 -- collector/hwmon_linux.go | 40 +- collector/infiniband_linux.go | 4 +- collector/interrupts_linux.go | 35 +- collector/interrupts_linux_test.go | 36 +- collector/interrupts_openbsd.go | 4 +- collector/ipvs_linux.go | 2 +- collector/ipvs_linux_test.go | 8 +- collector/loadavg_linux_test.go | 3 + collector/logind_linux_test.go | 3 + collector/meminfo.go | 4 +- collector/meminfo_linux_test.go | 3 + collector/meminfo_netbsd.go | 43 ++ collector/meminfo_numa_linux_test.go | 3 + collector/meminfo_openbsd.go | 4 +- collector/memory_bsd.go | 1 + collector/netclass_linux.go | 134 ++--- collector/netclass_rtnl_linux.go | 230 ++++++++ collector/netdev_common.go | 2 +- collector/netdev_linux.go | 105 +++- collector/netdev_linux_test.go | 13 +- collector/netdev_openbsd.go | 4 +- collector/netisr_freebsd.go | 105 ++++ collector/netstat_linux.go | 4 +- collector/netstat_linux_test.go | 3 + collector/nfsd_linux.go | 6 + collector/ntp.go | 4 +- collector/nvme_linux.go | 4 +- collector/os_release.go | 43 +- collector/os_release_test.go | 42 ++ collector/paths.go | 2 +- collector/paths_test.go | 2 +- collector/perf_linux.go | 166 ++++-- collector/perf_linux_test.go | 7 +- collector/powersupplyclass.go | 2 +- collector/pressure_linux.go | 8 + collector/processes_linux_test.go | 2 +- collector/qdisc_linux.go | 35 +- collector/rapl_linux.go | 2 +- collector/runit.go | 6 +- collector/selinux_linux.go | 4 +- collector/slabinfo_linux.go | 4 +- collector/softirq_linux.go | 68 +++ collector/softirqs_common.go | 50 ++ collector/softnet_linux.go | 64 ++- collector/stat_linux.go | 2 +- collector/supervisord.go | 4 +- collector/sysctl_linux.go | 2 +- collector/systemd_linux.go | 55 +- collector/systemd_linux_test.go | 5 +- collector/tapestats_linux.go | 2 +- collector/tcpstat_linux_test.go | 6 +- collector/textfile.go | 20 +- collector/textfile_test.go | 5 +- collector/thermal_zone_linux.go | 7 + collector/time_linux.go | 4 +- collector/timex.go | 5 +- collector/uname.go | 4 +- collector/uname_bsd.go | 4 +- collector/vmstat_linux.go | 2 +- collector/watchdog.go | 140 +++++ collector/watchdog_test.go | 92 +++ collector/wifi_linux.go | 2 +- collector/xfrm.go | 228 ++++++++ collector/xfrm_test.go | 151 +++++ collector/zfs.go | 2 +- collector/zfs_freebsd.go | 29 +- collector/zfs_linux.go | 6 +- collector/zfs_linux_test.go | 11 +- collector/zfs_solaris.go | 4 +- docs/TIME.md | 2 + docs/node-mixin/alerts/alerts.libsonnet | 188 +++++-- docs/node-mixin/config.libsonnet | 35 +- docs/node-mixin/dashboards/use.libsonnet | 10 +- docs/node-mixin/lib/prom-mixin.libsonnet | 95 ++-- end-to-end-test.sh | 10 +- examples/systemd/README.md | 2 +- examples/systemd/node_exporter.service | 3 +- examples/systemd/node_exporter.socket | 8 + go.mod | 35 +- go.sum | 510 ++--------------- node_exporter.go | 88 +-- .../perconacollector/textfile.directory.go | 9 +- .../tests/upstream_update/env_prepare_test.go | 2 +- percona/tests/upstream_update/metrics_test.go | 10 +- .../tests/upstream_update/performance_test.go | 11 +- percona/tests/upstream_update/utils_test.go | 15 +- scripts/codespell_ignore.txt | 9 - scripts/errcheck_excludes.txt | 4 - ttar | 6 +- 163 files changed, 5131 insertions(+), 2049 deletions(-) create mode 100644 .github/workflows/container_description.yml create mode 100644 collector/cpu_netbsd.go create mode 100644 collector/cpu_netbsd_test.go create mode 100644 collector/cpu_vulnerabilities_linux.go create mode 100644 collector/cpufreq_common.go rename collector/{filesystem_openbsd_amd64.go => filesystem_openbsd.go} (90%) create mode 100644 collector/fixtures/proc/interrupts_aarch64 create mode 100644 collector/fixtures/proc/net/xfrm_stat create mode 100644 collector/fixtures/proc/softirqs rename collector/fixtures/proc/spl/kstat/zfs/{dbuf_stats => dbufstats} (100%) create mode 100644 collector/fixtures/proc/spl/kstat/zfs/pool2/state create mode 100644 collector/fixtures/udev.ttar delete mode 100644 collector/fixtures/udev/data/b11:0 delete mode 100644 collector/fixtures/udev/data/b179:0 delete mode 100644 collector/fixtures/udev/data/b179:1 delete mode 100644 collector/fixtures/udev/data/b179:2 delete mode 100644 collector/fixtures/udev/data/b252:0 delete mode 100644 collector/fixtures/udev/data/b252:1 delete mode 100644 collector/fixtures/udev/data/b252:2 delete mode 100644 collector/fixtures/udev/data/b252:3 delete mode 100644 collector/fixtures/udev/data/b252:4 delete mode 100644 collector/fixtures/udev/data/b252:5 delete mode 100644 collector/fixtures/udev/data/b254:0 delete mode 100644 collector/fixtures/udev/data/b259:0 delete mode 100644 collector/fixtures/udev/data/b8:0 delete mode 100644 collector/fixtures/udev/data/b8:16 delete mode 100644 collector/fixtures/udev/data/b8:32 create mode 100644 collector/meminfo_netbsd.go create mode 100644 collector/netclass_rtnl_linux.go create mode 100644 collector/netisr_freebsd.go create mode 100644 collector/softirq_linux.go create mode 100644 collector/softirqs_common.go create mode 100644 collector/watchdog.go create mode 100644 collector/watchdog_test.go create mode 100644 collector/xfrm.go create mode 100644 collector/xfrm_test.go create mode 100644 examples/systemd/node_exporter.socket delete mode 100644 scripts/codespell_ignore.txt delete mode 100644 scripts/errcheck_excludes.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c5893a033..8cf200b826 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,16 +1,16 @@ --- version: 2.1 orbs: - prometheus: prometheus/prometheus@0.16.0 + prometheus: prometheus/prometheus@0.17.1 executors: # Whenever the Go version is updated here, .promu.yml and .promu-cgo.yml # should also be updated. golang: docker: - - image: cimg/go:1.19 + - image: cimg/go:1.22 arm: machine: - image: ubuntu-2004:current + image: ubuntu-2204:current resource_class: arm.medium jobs: @@ -28,13 +28,6 @@ jobs: - checkout - run: uname -a - run: make test-e2e - codespell: - docker: - - image: circleci/python - steps: - - checkout - - run: sudo pip install codespell - - run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem,./collector/fixtures" -I scripts/codespell_ignore.txt test_mixins: executor: golang steps: @@ -49,13 +42,23 @@ jobs: - run: git diff --exit-code build: machine: - image: ubuntu-2004:202101-01 + image: ubuntu-2204:current parallelism: 3 steps: - prometheus/setup_environment - - run: docker run --privileged linuxkit/binfmt:v0.8 + - run: docker run --privileged linuxkit/binfmt:af88a591f9cc896a52ce596b9cf7ca26a061ef97 - run: promu crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX - run: promu --config .promu-cgo.yml crossbuild -v --parallelism $CIRCLE_NODE_TOTAL --parallelism-thread $CIRCLE_NODE_INDEX + # sign the darwin build so it doesn't get SIGKILLed on start, see: https://github.com/prometheus/node_exporter/issues/2539 + - run: + command: | + if [[ -f "$(pwd)/.build/darwin-arm64/node_exporter" ]]; then + promu codesign "$(pwd)/.build/darwin-arm64/node_exporter" + fi + + if [[ -f "$(pwd)/.build/darwin-amd64/node_exporter" ]]; then + promu codesign "$(pwd)/.build/darwin-amd64/node_exporter" + fi - persist_to_workspace: root: . paths: @@ -65,9 +68,9 @@ jobs: destination: /build test_docker: machine: - image: ubuntu-2204:2022.04.2 + image: ubuntu-2204:current environment: - DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base + DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.22-base REPO_PATH: github.com/prometheus/node_exporter steps: - prometheus/setup_environment @@ -105,10 +108,6 @@ workflows: filters: tags: only: /.*/ - - codespell: - filters: - tags: - only: /.*/ - test_docker: requires: - test diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 881625b88e..ff07009480 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -6,7 +6,7 @@ Before filing a bug report, note that running node_exporter in Docker is not recommended, for the reasons detailed in the README: - https://github.com/prometheus/node_exporter#using-docker + https://github.com/prometheus/node_exporter#docker Finally, also note that node_exporter is focused on *NIX kernels, and the WMI exporter should be used instead on Windows. @@ -23,6 +23,8 @@ ### node_exporter command line flags +### node_exporter log output + ### Are you running node_exporter in Docker? diff --git a/.github/workflows/container_description.yml b/.github/workflows/container_description.yml new file mode 100644 index 0000000000..a7d7e150c0 --- /dev/null +++ b/.github/workflows/container_description.yml @@ -0,0 +1,52 @@ +--- +name: Push README to Docker Hub +on: + push: + paths: + - "README.md" + - ".github/workflows/container_description.yml" + branches: [ main, master ] + +permissions: + contents: read + +jobs: + PushDockerHubReadme: + runs-on: ubuntu-latest + name: Push README to Docker Hub + if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. + steps: + - name: git checkout + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Set docker hub repo name + run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV + - name: Push README to Dockerhub + uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1 + env: + DOCKER_USER: ${{ secrets.DOCKER_HUB_LOGIN }} + DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }} + with: + destination_container_repo: ${{ env.DOCKER_REPO_NAME }} + provider: dockerhub + short_description: ${{ env.DOCKER_REPO_NAME }} + readme_file: 'README.md' + + PushQuayIoReadme: + runs-on: ubuntu-latest + name: Push README to quay.io + if: github.repository_owner == 'prometheus' || github.repository_owner == 'prometheus-community' # Don't run this workflow on forks. + steps: + - name: git checkout + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Set quay.io org name + run: echo "DOCKER_REPO=$(echo quay.io/${GITHUB_REPOSITORY_OWNER} | tr -d '-')" >> $GITHUB_ENV + - name: Set quay.io repo name + run: echo "DOCKER_REPO_NAME=$(make docker-repo-name)" >> $GITHUB_ENV + - name: Push README to quay.io + uses: christian-korneck/update-container-description-action@d36005551adeaba9698d8d67a296bd16fa91f8e8 # v1 + env: + DOCKER_APIKEY: ${{ secrets.QUAY_IO_API_TOKEN }} + with: + destination_container_repo: ${{ env.DOCKER_REPO_NAME }} + provider: quay + readme_file: 'README.md' diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8284446e24..3a5701bd93 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,3 +1,5 @@ +--- +# This action is synced from https://github.com/prometheus/prometheus name: golangci-lint on: push: @@ -10,24 +12,28 @@ on: - ".golangci.yml" pull_request: +permissions: # added using https://github.com/step-security/secure-repo + contents: read + jobs: golangci: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for golangci/golangci-lint-action to fetch pull requests name: lint runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 - + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - name: install Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: 1.18.x - + go-version: 1.22.x - name: Install snmp_exporter/generator dependencies run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' - name: Lint - uses: golangci/golangci-lint-action@v6.1.1 + uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5.1.0 with: - version: v1.45.2 + version: v1.56.2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe68d9ef8f..84df5cc88f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,13 +24,6 @@ jobs: name: node_exporter path: node_exporter - codespell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: sudo pip install codespell - - run: codespell --skip=".git,ttar,go.mod,go.sum,*pem,./collector/fixtures" -I scripts/codespell_ignore.txt - test_mixins: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index 494df2e03d..a2e66eb96b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ dependencies-stamp # Test files extracted from ttar collector/fixtures/sys/ +collector/fixtures/udev/ /vendor diff --git a/.golangci.yml b/.golangci.yml index 0412d93b82..472b3a5e13 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,7 @@ linters: enable: + - depguard + - misspell - revive disable: # Disable soon to deprecated[1] linters that lead to false @@ -18,5 +20,23 @@ issues: - errcheck linters-settings: + depguard: + rules: + no_exec_policy: + files: + - "!$test" + deny: + - pkg: "os/exec" + desc: "Using os/exec to run sub processes it not allowed by policy" errcheck: - exclude: scripts/errcheck_excludes.txt + exclude-functions: + # Used in HTTP handlers, any error is handled by the server itself. + - (net/http.ResponseWriter).Write + # Never check for logger errors. + - (github.com/go-kit/log.Logger).Log + revive: + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter + - name: unused-parameter + severity: warning + disabled: true diff --git a/.promu-cgo.yml b/.promu-cgo.yml index 2bde1bf111..f270f78a29 100644 --- a/.promu-cgo.yml +++ b/.promu-cgo.yml @@ -1,14 +1,13 @@ go: # Whenever the Go version is updated here, .circle/config.yml and # .promu.yml should also be updated. - version: 1.19 + version: 1.22 cgo: true repository: path: github.com/prometheus/node_exporter build: binaries: - name: node_exporter - flags: -a -tags 'netgo osusergo static_build' ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} diff --git a/.promu.yml b/.promu.yml index 0c0351020e..8f883591a1 100644 --- a/.promu.yml +++ b/.promu.yml @@ -1,13 +1,12 @@ go: # Whenever the Go version is updated here, .circle/config.yml and # .promu-cgo.yml should also be updated. - version: 1.19 + version: 1.22 repository: path: github.com/prometheus/node_exporter build: binaries: - name: node_exporter - flags: -a -tags 'netgo osusergo static_build' ldflags: | -X github.com/prometheus/common/version.Version={{.Version}} -X github.com/prometheus/common/version.Revision={{.Revision}} diff --git a/.yamllint b/.yamllint index 3878a31d30..1859cb624b 100644 --- a/.yamllint +++ b/.yamllint @@ -1,5 +1,7 @@ --- extends: default +ignore: | + ui/react-app/node_modules rules: braces: @@ -20,9 +22,4 @@ rules: config/testdata/section_key_dup.bad.yml line-length: disable truthy: - ignore: | - .github/workflows/codeql-analysis.yml - .github/workflows/funcbench.yml - .github/workflows/fuzzing.yml - .github/workflows/prombench.yml - .github/workflows/golangci-lint.yml + check-keys: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3e819006..ee248324cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,115 @@ * [ENHANCEMENT] * [BUGFIX] +## 1.8.2 / 2024-06-19 + +* [BUGFIX] Fix CPU pressure metric collection #3054 + +## 1.8.1 / 2024-05-16 + +* [BUGFIX] Fix CPU seconds on Solaris #2963 +* [BUGFIX] Sign Darwin/MacOS binaries #3008 +* [BUGFIX] Fix pressure collector nil reference #3016 + +## 1.8.0 / 2024-04-24 + +* [CHANGE] exec_bsd: Fix labels for `vm.stats.sys.v_syscall` sysctl #2895 +* [CHANGE] diskstats: Ignore zram devices on linux systems #2898 +* [CHANGE] textfile: Avoid inconsistent help-texts #2962 +* [CHANGE] os: Removed caching of modtime/filename of os-release file #2987 +* [FEATURE] xfrm: Add new collector #2866 +* [FEATURE] watchdog: Add new collector #2880 +* [ENHANCEMENT] cpu_vulnerabilities: Add mitigation information label #2806 +* [ENHANCEMENT] nfsd: Handle new `wdeleg_getattr` attribute #2810 +* [ENHANCEMENT] netstat: Add TCPOFOQueue to default netstat metrics #2867 +* [ENHANCEMENT] filesystem: surface device errors #2923 +* [ENHANCEMENT] os: Add support end parsing #2982 +* [ENHANCEMENT] zfs: Log mib when sysctl read fails on FreeBSD #2975 +* [ENHANCEMENT] fibre_channel: update procfs to take into account optional attributes #2933 +* [BUGFIX] cpu: Fix debug log in cpu collector #2857 +* [BUGFIX] hwmon: Fix hwmon nil ptr #2873 +* [BUGFIX] hwmon: Fix hwmon error capture #2915 +* [BUGFIX] zfs: Revert "Add ZFS freebsd per dataset stats #2925 +* [BUGFIX] ethtool: Sanitize ethtool metric name keys #2940 +* [BUGFIX] fix: data race of NetClassCollector metrics initialization #2995 + +## 1.7.0 / 2023-11-11 + +* [FEATURE] Add ZFS freebsd per dataset stats #2753 +* [FEATURE] Add cpu vulnerabilities reporting from sysfs #2721 +* [ENHANCEMENT] Parallelize stat calls in Linux filesystem collector #1772 +* [ENHANCEMENT] Add missing linkspeeds to ethtool collector 2711 +* [ENHANCEMENT] Add CPU MHz as the value for `node_cpu_info` metric #2778 +* [ENHANCEMENT] Improve qdisc collector performance #2779 +* [ENHANCEMENT] Add include and exclude filter for hwmon collector #2699 +* [ENHANCEMENT] Optionally fetch ARP stats via rtnetlink instead of procfs #2777 +* [BUFFIX] Fix ZFS arcstats on FreeBSD 14.0+ 2754 +* [BUGFIX] Fallback to 32-bit stats in netdev #2757 +* [BUGFIX] Close btrfs.FS handle after use #2780 +* [BUGFIX] Move RO status before error return #2807 +* [BUFFIX] Fix `promhttp_metric_handler_errors_total` being always active #2808 +* [BUGFIX] Fix nfsd v4 index miss #2824 + +## 1.6.1 / 2023-06-17 + +Rebuild with latest Go compiler bugfix release. + +## 1.6.0 / 2023-05-27 + +* [CHANGE] Fix cpustat when some cpus are offline #2318 +* [CHANGE] Remove metrics of offline CPUs in CPU collector #2605 +* [CHANGE] Deprecate ntp collector #2603 +* [CHANGE] Remove bcache `cache_readaheads_totals` metrics #2583 +* [CHANGE] Deprecate supervisord collector #2685 +* [FEATURE] Enable uname collector on NetBSD #2559 +* [FEATURE] NetBSD support for the meminfo collector #2570 +* [FEATURE] NetBSD support for CPU collector #2626 +* [FEATURE] Add FreeBSD collector for netisr subsystem #2668 +* [FEATURE] Add softirqs collector #2669 +* [ENHANCEMENT] Add suspended as a `node_zfs_zpool_state` #2449 +* [ENHANCEMENT] Add administrative state of Linux network interfaces #2515 +* [ENHANCEMENT] Log current value of GOMAXPROCS #2537 +* [ENHANCEMENT] Add profiler options for perf collector #2542 +* [ENHANCEMENT] Allow root path as metrics path #2590 +* [ENHANCEMENT] Add cpu frequency governor metrics #2569 +* [ENHANCEMENT] Add new landing page #2622 +* [ENHANCEMENT] Reduce privileges needed for btrfs device stats #2634 +* [ENHANCEMENT] Add ZFS `memory_available_bytes` #2687 +* [ENHANCEMENT] Use `SCSI_IDENT_SERIAL` as serial in diskstats #2612 +* [ENHANCEMENT] Read missing from netlink netclass attributes from sysfs #2669 +* [BUGFIX] perf: fixes for automatically detecting the correct tracefs mountpoints #2553 +* [BUGFIX] Fix `thermal_zone` collector noise #2554 +* [BUGFIX] Fix a problem fetching the user wire count on FreeBSD #2584 +* [BUGFIX] interrupts: Fix fields on linux aarch64 #2631 +* [BUGFIX] Remove metrics of offline CPUs in CPU collector #2605 +* [BUGFIX] Fix OpenBSD filesystem collector string parsing #2637 +* [BUGFIX] Fix bad reporting of `node_cpu_seconds_total` in OpenBSD #2663 + +## 1.5.0 / 2022-11-29 + +NOTE: This changes the Go runtime "GOMAXPROCS" to 1. This is done to limit the + concurrency of the exporter to 1 CPU thread at a time in order to avoid a + race condition problem in the Linux kernel (#2500) and parallel IO issues + on nodes with high numbers of CPUs/CPU threads (#1880). + +NOTE: A command line arg has been changed from `--web.config` to `--web.config.file`. + +* [CHANGE] Default GOMAXPROCS to 1 #2530 +* [FEATURE] Add multiple listeners and systemd socket listener activation #2393 +* [ENHANCEMENT] Add RTNL version of netclass collector #2492, #2528 +* [BUGFIX] Fix diskstats exclude flags #2487 +* [BUGFIX] Bump go/x/crypt and go/x/net #2488 +* [BUGFIX] Fix hwmon label sanitizer #2504 +* [BUGFIX] Use native endianness when encoding InetDiagMsg #2508 +* [BUGFIX] Fix btrfs device stats always being zero #2516 +* [BUGFIX] Security: Update exporter-toolkit (CVE-2022-46146) #2531 + +## 1.4.1 / 2022-11-29 + +* [BUGFIX] Fix diskstats exclude flags #2487 +* [BUGFIX] Security: Update go/x/crypto and go/x/net (CVE-2022-27191 CVE-2022-27664) #2488 +* [BUGFIX] Security: Update exporter-toolkit (CVE-2022-46146) #2531 + ## 1.4.0 / 2022-09-24 * [CHANGE] Merge metrics descriptions in textfile collector #2475 @@ -74,9 +183,9 @@ NOTE: In order to support globs in the textfile collector path, filenames expose * [ENHANCEMENT] Add flag to disable guest CPU metrics #2123 * [ENHANCEMENT] Add DMI collector #2131 * [ENHANCEMENT] Add threads metrics to processes collector #2164 -* [ENHANCMMENT] Reduce timer GC delays in the Linux filesystem collector #2169 -* [ENHANCMMENT] Add TCPTimeouts to netstat default filter #2189 -* [ENHANCMMENT] Use SysctlTimeval for boottime collector on BSD #2208 +* [ENHANCEMENT] Reduce timer GC delays in the Linux filesystem collector #2169 +* [ENHANCEMENT] Add TCPTimeouts to netstat default filter #2189 +* [ENHANCEMENT] Use SysctlTimeval for boottime collector on BSD #2208 * [BUGFIX] ethtool: Sanitize metric names #2093 * [BUGFIX] Fix ethtool collector for multiple interfaces #2126 * [BUGFIX] Fix possible panic on macOS #2133 @@ -114,7 +223,7 @@ NOTE: Filesystem collector flags have been renamed. `--collector.filesystem.igno * [BUGFIX] Fix wrong value for OpenBSD memory buffer cache #2015 * [BUGFIX] Only initiate collectors once #2048 * [BUGFIX] Handle small backwards jumps in CPU idle #2067 - + ## 1.1.2 / 2021-03-05 * [BUGFIX] Handle errors from disabled PSI subsystem #1983 @@ -406,7 +515,7 @@ Other breaking changes: **Breaking changes** This release contains major breaking changes to flag handling. -* The flag library has been changed, all flags now require double-dashs. (`-foo` becomes `--foo`). +* The flag library has been changed, all flags now require double-dashes. (`-foo` becomes `--foo`). * The collector selection flag has been replaced by individual boolean flags. * The `-collector.procfs` and `-collector.sysfs` flags have been renamed to `--path.procfs` and `--path.sysfs` respectively. diff --git a/Makefile b/Makefile index af87b0b572..b19480e667 100644 --- a/Makefile +++ b/Makefile @@ -92,12 +92,12 @@ export PMM_RELEASE_PATH?=. all:: vet checkmetrics checkrules common-all $(cross-test) $(test-e2e) .PHONY: test -test: collector/fixtures/sys/.unpacked +test: collector/fixtures/sys/.unpacked collector/fixtures/udev/.unpacked @echo ">> running tests" $(GO) test -short $(test-flags) $(pkgs) .PHONY: test-32bit -test-32bit: collector/fixtures/sys/.unpacked +test-32bit: collector/fixtures/sys/.unpacked collector/fixtures/udev/.unpacked @echo ">> running tests in 32-bit mode" @env GOARCH=$(GOARCH_CROSS) $(GO) test $(pkgs) @@ -114,9 +114,12 @@ skip-test-32bit: update_fixtures: rm -vf collector/fixtures/sys/.unpacked ./ttar -C collector/fixtures -c -f collector/fixtures/sys.ttar sys + rm -vf collector/fixtures/udev/.unpacked + ./ttar -C collector/fixtures -c -f collector/fixtures/udev.ttar udev + .PHONY: test-e2e -test-e2e: build collector/fixtures/sys/.unpacked +test-e2e: build collector/fixtures/sys/.unpacked collector/fixtures/udev/.unpacked @echo ">> running end-to-end tests" ./end-to-end-test.sh diff --git a/Makefile.common b/Makefile.common index 7642c4485c..0e9ace29b4 100644 --- a/Makefile.common +++ b/Makefile.common @@ -49,23 +49,23 @@ endif GOTEST := $(GO) test GOTEST_DIR := ifneq ($(CIRCLE_JOB),) -ifneq ($(shell which gotestsum),) +ifneq ($(shell command -v gotestsum 2> /dev/null),) GOTEST_DIR := test-results GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml -- endif endif -PROMU_VERSION ?= 0.13.0 +PROMU_VERSION ?= 0.17.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.49.0 -# golangci-lint only supports linux, darwin and windows platforms on i386/amd64. +GOLANGCI_LINT_VERSION ?= v1.56.2 +# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) - ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386)) + ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386 arm64)) # If we're in CI and there is an Actions file, that means the linter # is being run in Actions, so we don't need to run it here. ifneq (,$(SKIP_GOLANGCI_LINT)) @@ -91,6 +91,8 @@ BUILD_DOCKER_ARCHS = $(addprefix common-docker-,$(DOCKER_ARCHS)) PUBLISH_DOCKER_ARCHS = $(addprefix common-docker-publish-,$(DOCKER_ARCHS)) TAG_DOCKER_ARCHS = $(addprefix common-docker-tag-latest-,$(DOCKER_ARCHS)) +SANITIZED_DOCKER_IMAGE_TAG := $(subst +,-,$(DOCKER_IMAGE_TAG)) + ifeq ($(GOHOSTARCH),amd64) ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) # Only supported on amd64 @@ -167,16 +169,20 @@ common-vet: common-lint: $(GOLANGCI_LINT) ifdef GOLANGCI_LINT @echo ">> running golangci-lint" -# 'go list' needs to be executed before staticcheck to prepopulate the modules cache. -# Otherwise staticcheck might fail randomly for some reason not yet explained. - $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) endif +.PHONY: common-lint-fix +common-lint-fix: $(GOLANGCI_LINT) +ifdef GOLANGCI_LINT + @echo ">> running golangci-lint fix" + $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_OPTS) $(pkgs) +endif + .PHONY: common-yamllint common-yamllint: @echo ">> running yamllint on all YAML files in the repository" -ifeq (, $(shell which yamllint)) +ifeq (, $(shell command -v yamllint 2> /dev/null)) @echo "yamllint not installed so skipping" else yamllint . @@ -202,10 +208,14 @@ common-tarball: promu @echo ">> building release tarball" $(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) +.PHONY: common-docker-repo-name +common-docker-repo-name: + @echo "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)" + .PHONY: common-docker $(BUILD_DOCKER_ARCHS) common-docker: $(BUILD_DOCKER_ARCHS) $(BUILD_DOCKER_ARCHS): common-docker-%: - docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" \ + docker build -t "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" \ -f $(DOCKERFILE_PATH) \ --build-arg ARCH="$*" \ --build-arg OS="linux" \ @@ -214,19 +224,19 @@ $(BUILD_DOCKER_ARCHS): common-docker-%: .PHONY: common-docker-publish $(PUBLISH_DOCKER_ARCHS) common-docker-publish: $(PUBLISH_DOCKER_ARCHS) $(PUBLISH_DOCKER_ARCHS): common-docker-publish-%: - docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" + docker push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" DOCKER_MAJOR_VERSION_TAG = $(firstword $(subst ., ,$(shell cat VERSION))) .PHONY: common-docker-tag-latest $(TAG_DOCKER_ARCHS) common-docker-tag-latest: $(TAG_DOCKER_ARCHS) $(TAG_DOCKER_ARCHS): common-docker-tag-latest-%: - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" - docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:latest" + docker tag "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:$(SANITIZED_DOCKER_IMAGE_TAG)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$*:v$(DOCKER_MAJOR_VERSION_TAG)" .PHONY: common-docker-manifest common-docker-manifest: - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(DOCKER_IMAGE_TAG)) - DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create -a "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" $(foreach ARCH,$(DOCKER_ARCHS),$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME)-linux-$(ARCH):$(SANITIZED_DOCKER_IMAGE_TAG)) + DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" .PHONY: promu promu: $(PROMU) diff --git a/README.md b/README.md index 1adf75623c..ad385650a4 100644 --- a/README.md +++ b/README.md @@ -22,18 +22,14 @@ The `node_exporter` listens on HTTP port 9100 by default. See the `--help` outpu ### Ansible -For automated installs with [Ansible](https://www.ansible.com/), there is the [Cloud Alchemy role](https://github.com/cloudalchemy/ansible-node-exporter). - -### RHEL/CentOS/Fedora - -There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/) which closely follows upstream releases. +For automated installs with [Ansible](https://www.ansible.com/), there is the [Prometheus Community role](https://github.com/prometheus-community/ansible). ### Docker -The `node_exporter` is designed to monitor the host system. It's not recommended -to deploy it as a Docker container because it requires access to the host system. +The `node_exporter` is designed to monitor the host system. Deploying in containers requires +extra care in order to avoid monitoring the container itself. -For situations where Docker deployment is needed, some extra flags must be used to allow +For situations where containerized deployment is needed, some extra flags must be used to allow the `node_exporter` access to the host namespaces. Be aware that any non-root mount points you want to monitor will need to be bind-mounted @@ -83,6 +79,34 @@ Collectors are enabled by providing a `--collector.` flag. Collectors that are enabled by default can be disabled by providing a `--no-collector.` flag. To enable only some specific collector(s), use `--collector.disable-defaults --collector. ...`. +### Include & Exclude flags + +A few collectors can be configured to include or exclude certain patterns using dedicated flags. The exclude flags are used to indicate "all except", while the include flags are used to say "none except". Note that these flags are mutually exclusive on collectors that support both. + +Example: + +```txt +--collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/) +``` + +List: + +Collector | Scope | Include Flag | Exclude Flag +--- | --- | --- | --- +arp | device | --collector.arp.device-include | --collector.arp.device-exclude +cpu | bugs | --collector.cpu.info.bugs-include | N/A +cpu | flags | --collector.cpu.info.flags-include | N/A +diskstats | device | --collector.diskstats.device-include | --collector.diskstats.device-exclude +ethtool | device | --collector.ethtool.device-include | --collector.ethtool.device-exclude +ethtool | metrics | --collector.ethtool.metrics-include | N/A +filesystem | fs-types | N/A | --collector.filesystem.fs-types-exclude +filesystem | mount-points | N/A | --collector.filesystem.mount-points-exclude +hwmon | chip | --collector.hwmon.chip-include | --collector.hwmon.chip-exclude +netdev | device | --collector.netdev.device-include | --collector.netdev.device-exclude +qdisk | device | --collector.qdisk.device-include | --collector.qdisk.device-exclude +sysctl | all | --collector.sysctl.include | N/A +systemd | unit | --collector.systemd.unit-include | --collector.systemd.unit-exclude + ### Enabled by default Name | Description | OS @@ -111,6 +135,7 @@ mdadm | Exposes statistics about devices in `/proc/mdstat` (does nothing if no ` meminfo | Exposes memory statistics. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD netclass | Exposes network interface info from `/sys/class/net/` | Linux netdev | Exposes network interface statistics such as bytes transferred. | Darwin, Dragonfly, FreeBSD, Linux, OpenBSD +netisr | Exposes netisr statistics | FreeBSD netstat | Exposes network statistics from `/proc/net/netstat`. This is the same information as `netstat -s`. | Linux nfs | Exposes NFS client statistics from `/proc/net/rpc/nfs`. This is the same information as `nfsstat -c`. | Linux nfsd | Exposes NFS kernel server statistics from `/proc/net/rpc/nfsd`. This is the same information as `nfsstat -s`. | Linux @@ -133,6 +158,7 @@ timex | Exposes selected adjtimex(2) system call stats. | Linux udp_queues | Exposes UDP total lengths of the rx_queue and tx_queue from `/proc/net/udp` and `/proc/net/udp6`. | Linux uname | Exposes system information as provided by the uname system call. | Darwin, FreeBSD, Linux, OpenBSD vmstat | Exposes statistics from `/proc/vmstat`. | Linux +watchdog | Exposes statistics from `/sys/class/watchdog` | Linux xfs | Exposes XFS runtime statistics. | Linux (kernel 4.4+) zfs | Exposes [ZFS](http://open-zfs.org/) performance statistics. | FreeBSD, [Linux](http://zfsonlinux.org/), Solaris @@ -159,29 +185,40 @@ Name | Description | OS ---------|-------------|---- buddyinfo | Exposes statistics of memory fragments as reported by /proc/buddyinfo. | Linux cgroups | A summary of the number of active and enabled cgroups | Linux +cpu\_vulnerabilities | Exposes CPU vulnerability information from sysfs. | Linux devstat | Exposes device statistics | Dragonfly, FreeBSD +drm | Expose GPU metrics using sysfs / DRM, `amdgpu` is the only driver which exposes this information through DRM | Linux drbd | Exposes Distributed Replicated Block Device statistics (to version 8.4) | Linux ethtool | Exposes network interface information and network driver statistics equivalent to `ethtool`, `ethtool -S`, and `ethtool -i`. | Linux interrupts | Exposes detailed interrupts statistics. | Linux, OpenBSD ksmd | Exposes kernel and system statistics from `/sys/kernel/mm/ksm`. | Linux lnstat | Exposes stats from `/proc/net/stat/`. | Linux logind | Exposes session counts from [logind](http://www.freedesktop.org/wiki/Software/systemd/logind/). | Linux -meminfo\_numa | Exposes memory statistics from `/proc/meminfo_numa`. | Linux +meminfo\_numa | Exposes memory statistics from `/sys/devices/system/node/node[0-9]*/meminfo`, `/sys/devices/system/node/node[0-9]*/numastat`. | Linux mountstats | Exposes filesystem statistics from `/proc/self/mountstats`. Exposes detailed NFS client statistics. | Linux network_route | Exposes the routing table as metrics | Linux -ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_ perf | Exposes perf based metrics (Warning: Metrics are dependent on kernel configuration and settings). | Linux processes | Exposes aggregate process statistics from `/proc`. | Linux qdisc | Exposes [queuing discipline](https://en.wikipedia.org/wiki/Network_scheduler#Linux_kernel) statistics | Linux -runit | Exposes service status from [runit](http://smarden.org/runit/). | _any_ slabinfo | Exposes slab statistics from `/proc/slabinfo`. Note that permission of `/proc/slabinfo` is usually 0400, so set it appropriately. | Linux -supervisord | Exposes service status from [supervisord](http://supervisord.org/). | _any_ +softirqs | Exposes detailed softirq statistics from `/proc/softirqs`. | Linux sysctl | Expose sysctl values from `/proc/sys`. Use `--collector.sysctl.include(-info)` to configure. | Linux systemd | Exposes service and system status from [systemd](http://www.freedesktop.org/wiki/Software/systemd/). | Linux tcpstat | Exposes TCP connection status information from `/proc/net/tcp` and `/proc/net/tcp6`. (Warning: the current version has potential performance issues in high load situations.) | Linux wifi | Exposes WiFi device and station statistics. | Linux +xfrm | Exposes statistics from `/proc/net/xfrm_stat` | Linux zoneinfo | Exposes NUMA memory zone metrics. | Linux +### Deprecated + +These collectors are deprecated and will be removed in the next major release. + +Name | Description | OS +---------|-------------|---- +ntp | Exposes local NTP daemon health to check [time](./docs/TIME.md) | _any_ +runit | Exposes service status from [runit](http://smarden.org/runit/). | _any_ +supervisord | Exposes service status from [supervisord](http://supervisord.org/). | _any_ + ### Perf Collector The `perf` collector may not work out of the box on some Linux systems due to kernel @@ -339,10 +376,10 @@ To see all available configuration flags: The exporter supports TLS via a new web configuration file. ```console -./node_exporter --web.config=web-config.yml +./node_exporter --web.config.file=web-config.yml ``` -See the [exporter-toolkit https package](https://github.com/prometheus/exporter-toolkit/blob/v0.1.0/https/README.md) for more details. +See the [exporter-toolkit web-configuration](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md) for more details. [travis]: https://travis-ci.org/prometheus/node_exporter [hub]: https://hub.docker.com/r/prom/node-exporter/ diff --git a/VERSION b/VERSION index 88c5fb891d..53adb84c82 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.0 +1.8.2 diff --git a/collector/arp_linux.go b/collector/arp_linux.go index 03d5ae9ba1..c7861156f3 100644 --- a/collector/arp_linux.go +++ b/collector/arp_linux.go @@ -17,23 +17,26 @@ package collector import ( - "bufio" + "errors" "fmt" - "io" - "os" - "strings" + "net" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" + "github.com/jsimonetti/rtnetlink" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" + "github.com/prometheus/procfs" + "golang.org/x/sys/unix" ) var ( arpDeviceInclude = kingpin.Flag("collector.arp.device-include", "Regexp of arp devices to include (mutually exclusive to device-exclude).").String() arpDeviceExclude = kingpin.Flag("collector.arp.device-exclude", "Regexp of arp devices to exclude (mutually exclusive to device-include).").String() + arpNetlink = kingpin.Flag("collector.arp.netlink", "Use netlink to gather stats instead of /proc/net/arp.").Default("true").Bool() ) type arpCollector struct { + fs procfs.FS deviceFilter deviceFilter entries *prometheus.Desc logger log.Logger @@ -45,7 +48,13 @@ func init() { // NewARPCollector returns a new Collector exposing ARP stats. func NewARPCollector(logger log.Logger) (Collector, error) { + fs, err := procfs.NewFS(*procPath) + if err != nil { + return nil, fmt.Errorf("failed to open procfs: %w", err) + } + return &arpCollector{ + fs: fs, deviceFilter: newDeviceFilter(*arpDeviceExclude, *arpDeviceInclude), entries: prometheus.NewDesc( prometheus.BuildFQName(namespace, "arp", "entries"), @@ -56,56 +65,77 @@ func NewARPCollector(logger log.Logger) (Collector, error) { }, nil } -func getARPEntries() (map[string]uint32, error) { - file, err := os.Open(procFilePath("net/arp")) +func getTotalArpEntries(deviceEntries []procfs.ARPEntry) map[string]uint32 { + entries := make(map[string]uint32) + + for _, device := range deviceEntries { + entries[device.Device]++ + } + + return entries +} + +func getTotalArpEntriesRTNL() (map[string]uint32, error) { + conn, err := rtnetlink.Dial(nil) if err != nil { return nil, err } - defer file.Close() + defer conn.Close() - entries, err := parseARPEntries(file) + neighbors, err := conn.Neigh.List() if err != nil { return nil, err } - return entries, nil -} - -// TODO: This should get extracted to the github.com/prometheus/procfs package -// to support more complete parsing of /proc/net/arp. Instead of adding -// more fields to this function's return values it should get moved and -// changed to support each field. -func parseARPEntries(data io.Reader) (map[string]uint32, error) { - scanner := bufio.NewScanner(data) - entries := make(map[string]uint32) - - for scanner.Scan() { - columns := strings.Fields(scanner.Text()) + ifIndexEntries := make(map[uint32]uint32) - if len(columns) < 6 { - return nil, fmt.Errorf("unexpected ARP table format") + for _, n := range neighbors { + // Neighbors will also contain IPv6 neighbors, but since this is purely an ARP collector, + // restrict to AF_INET. Also skip entries which have state NUD_NOARP to conform to output + // of /proc/net/arp. + if n.Family == unix.AF_INET && n.State&unix.NUD_NOARP == 0 { + ifIndexEntries[n.Index]++ } + } - if columns[0] != "IP" { - deviceIndex := len(columns) - 1 - entries[columns[deviceIndex]]++ + enumEntries := make(map[string]uint32) + + // Convert interface indexes to names. + for ifIndex, entryCount := range ifIndexEntries { + iface, err := net.InterfaceByIndex(int(ifIndex)) + if err != nil { + if errors.Unwrap(err).Error() == "no such network interface" { + continue + } + return nil, err } - } - if err := scanner.Err(); err != nil { - return nil, fmt.Errorf("failed to parse ARP info: %w", err) + enumEntries[iface.Name] = entryCount } - return entries, nil + return enumEntries, nil } func (c *arpCollector) Update(ch chan<- prometheus.Metric) error { - entries, err := getARPEntries() - if err != nil { - return fmt.Errorf("could not get ARP entries: %w", err) + var enumeratedEntry map[string]uint32 + + if *arpNetlink { + var err error + + enumeratedEntry, err = getTotalArpEntriesRTNL() + if err != nil { + return fmt.Errorf("could not get ARP entries: %w", err) + } + } else { + entries, err := c.fs.GatherARPEntries() + if err != nil { + return fmt.Errorf("could not get ARP entries: %w", err) + } + + enumeratedEntry = getTotalArpEntries(entries) } - for device, entryCount := range entries { + for device, entryCount := range enumeratedEntry { if c.deviceFilter.ignored(device) { continue } diff --git a/collector/bcache_linux.go b/collector/bcache_linux.go index 63a22d033a..1d402d3ff5 100644 --- a/collector/bcache_linux.go +++ b/collector/bcache_linux.go @@ -19,10 +19,10 @@ package collector import ( "fmt" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/bcache" - "gopkg.in/alecthomas/kingpin.v2" ) var ( @@ -134,14 +134,19 @@ func bcachePeriodStatsToMetric(ps *bcache.PeriodStats, labelValue string) []bcac extraLabel: label, extraLabelValue: labelValue, }, - { - name: "cache_readaheads_total", - desc: "Count of times readahead occurred.", - value: float64(ps.CacheReadaheads), - metricType: prometheus.CounterValue, - extraLabel: label, - extraLabelValue: labelValue, - }, + } + if ps.CacheReadaheads != 0 { + bcacheReadaheadMetrics := []bcacheMetric{ + { + name: "cache_readaheads_total", + desc: "Count of times readahead occurred.", + value: float64(ps.CacheReadaheads), + metricType: prometheus.CounterValue, + extraLabel: label, + extraLabelValue: labelValue, + }, + } + metrics = append(metrics, bcacheReadaheadMetrics...) } return metrics } diff --git a/collector/bonding_linux_test.go b/collector/bonding_linux_test.go index 564cf01e25..98af73fad8 100644 --- a/collector/bonding_linux_test.go +++ b/collector/bonding_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nobonding +// +build !nobonding + package collector import ( diff --git a/collector/boot_time_solaris.go b/collector/boot_time_solaris.go index 3d55e7835f..15955121f7 100644 --- a/collector/boot_time_solaris.go +++ b/collector/boot_time_solaris.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build solaris && !noboottime -// +build solaris,!noboottime +//go:build !noboottime +// +build !noboottime package collector diff --git a/collector/btrfs_linux.go b/collector/btrfs_linux.go index da888fba60..33c88d01e7 100644 --- a/collector/btrfs_linux.go +++ b/collector/btrfs_linux.go @@ -123,16 +123,19 @@ func (c *btrfsCollector) getIoctlStats() (map[string]*btrfsIoctlFsStats, error) continue } - fs, err := dennwc.Open(mount.mountPoint, true) + mountPath := rootfsFilePath(mount.mountPoint) + + fs, err := dennwc.Open(mountPath, true) if err != nil { // Failed to open this mount point, maybe we didn't have permission // maybe we'll find another mount point for this FS later. level.Debug(c.logger).Log( "msg", "Error inspecting btrfs mountpoint", - "mountPoint", mount.mountPoint, + "mountPoint", mountPath, "err", err) continue } + defer fs.Close() fsInfo, err := fs.Info() if err != nil { @@ -140,7 +143,7 @@ func (c *btrfsCollector) getIoctlStats() (map[string]*btrfsIoctlFsStats, error) // perhaps it'll work with a different mount point level.Debug(c.logger).Log( "msg", "Error querying btrfs filesystem", - "mountPoint", mount.mountPoint, + "mountPoint", mountPath, "err", err) continue } @@ -155,7 +158,7 @@ func (c *btrfsCollector) getIoctlStats() (map[string]*btrfsIoctlFsStats, error) if err != nil { level.Debug(c.logger).Log( "msg", "Error querying btrfs device stats", - "mountPoint", mount.mountPoint, + "mountPoint", mountPath, "err", err) continue } diff --git a/collector/collector.go b/collector/collector.go index 54f0ff6d58..3112c78970 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -20,10 +20,10 @@ import ( "sync" "time" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) // Namespace defines the common namespace to be used by all metrics. @@ -198,3 +198,49 @@ var ErrNoData = errors.New("collector returned no data") func IsNoDataError(err error) bool { return err == ErrNoData } + +// pushMetric helps construct and convert a variety of value types into Prometheus float64 metrics. +func pushMetric(ch chan<- prometheus.Metric, fieldDesc *prometheus.Desc, name string, value interface{}, valueType prometheus.ValueType, labelValues ...string) { + var fVal float64 + switch val := value.(type) { + case uint8: + fVal = float64(val) + case uint16: + fVal = float64(val) + case uint32: + fVal = float64(val) + case uint64: + fVal = float64(val) + case int64: + fVal = float64(val) + case *uint8: + if val == nil { + return + } + fVal = float64(*val) + case *uint16: + if val == nil { + return + } + fVal = float64(*val) + case *uint32: + if val == nil { + return + } + fVal = float64(*val) + case *uint64: + if val == nil { + return + } + fVal = float64(*val) + case *int64: + if val == nil { + return + } + fVal = float64(*val) + default: + return + } + + ch <- prometheus.MustNewConstMetric(fieldDesc, valueType, fVal, labelValues...) +} diff --git a/collector/collectorPerconaExtensions.go b/collector/collectorPerconaExtensions.go index b095b5e12a..ace605e666 100644 --- a/collector/collectorPerconaExtensions.go +++ b/collector/collectorPerconaExtensions.go @@ -17,8 +17,8 @@ package collector import ( "fmt" - "github.com/go-kit/log" - "gopkg.in/alecthomas/kingpin.v2" + kingpin "github.com/alecthomas/kingpin/v2" + log "github.com/go-kit/log" ) func RegisterCollectorPublic(collector string, isDefaultEnabled bool, factory func(logger log.Logger) (Collector, error)) { diff --git a/collector/cpu_linux.go b/collector/cpu_linux.go index 933774bc3e..75d2a795b2 100644 --- a/collector/cpu_linux.go +++ b/collector/cpu_linux.go @@ -21,21 +21,24 @@ import ( "os" "path/filepath" "regexp" + "slices" "strconv" "sync" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" "github.com/prometheus/procfs/sysfs" - "gopkg.in/alecthomas/kingpin.v2" + "golang.org/x/exp/maps" ) type cpuCollector struct { fs procfs.FS cpu *prometheus.Desc cpuInfo *prometheus.Desc + cpuFrequencyHz *prometheus.Desc cpuFlagsInfo *prometheus.Desc cpuBugsInfo *prometheus.Desc cpuGuest *prometheus.Desc @@ -43,7 +46,7 @@ type cpuCollector struct { cpuPackageThrottle *prometheus.Desc cpuIsolated *prometheus.Desc logger log.Logger - cpuStats []procfs.CPUStat + cpuStats map[int64]procfs.CPUStat cpuStatsMutex sync.Mutex isolatedCpus []uint16 @@ -94,6 +97,11 @@ func NewCPUCollector(logger log.Logger) (Collector, error) { "CPU information from /proc/cpuinfo.", []string{"package", "core", "cpu", "vendor", "family", "model", "model_name", "microcode", "stepping", "cachesize"}, nil, ), + cpuFrequencyHz: prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), + "CPU frequency in hertz from /proc/cpuinfo.", + []string{"package", "core", "cpu"}, nil, + ), cpuFlagsInfo: prometheus.NewDesc( prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "flag_info"), "The `flags` field of CPU information from /proc/cpuinfo taken from the first core.", @@ -126,6 +134,7 @@ func NewCPUCollector(logger log.Logger) (Collector, error) { ), logger: logger, isolatedCpus: isolcpus, + cpuStats: make(map[int64]procfs.CPUStat), } err = c.compileIncludeFlags(flagsInclude, bugsInclude) if err != nil { @@ -194,6 +203,20 @@ func (c *cpuCollector) updateInfo(ch chan<- prometheus.Metric) error { cpu.CacheSize) } + cpuFreqEnabled, ok := collectorState["cpufreq"] + if !ok || cpuFreqEnabled == nil { + level.Debug(c.logger).Log("msg", "cpufreq key missing or nil value in collectorState map") + } else if !*cpuFreqEnabled { + for _, cpu := range info { + ch <- prometheus.MustNewConstMetric(c.cpuFrequencyHz, + prometheus.GaugeValue, + cpu.CPUMHz*1e6, + cpu.PhysicalID, + cpu.CoreID, + strconv.Itoa(int(cpu.Processor))) + } + } + if len(info) != 0 { cpu := info[0] if err := updateFieldInfo(cpu.Flags, c.cpuFlagsIncludeRegexp, c.cpuFlagsInfo, ch); err != nil { @@ -324,7 +347,7 @@ func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error { c.cpuStatsMutex.Lock() defer c.cpuStatsMutex.Unlock() for cpuID, cpuStat := range c.cpuStats { - cpuNum := strconv.Itoa(cpuID) + cpuNum := strconv.Itoa(int(cpuID)) ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.User, cpuNum, "user") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.Nice, cpuNum, "nice") ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, cpuStat.System, cpuNum, "system") @@ -345,82 +368,90 @@ func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error { } // updateCPUStats updates the internal cache of CPU stats. -func (c *cpuCollector) updateCPUStats(newStats []procfs.CPUStat) { +func (c *cpuCollector) updateCPUStats(newStats map[int64]procfs.CPUStat) { // Acquire a lock to update the stats. c.cpuStatsMutex.Lock() defer c.cpuStatsMutex.Unlock() // Reset the cache if the list of CPUs has changed. - if len(c.cpuStats) != len(newStats) { - c.cpuStats = make([]procfs.CPUStat, len(newStats)) - } - for i, n := range newStats { + cpuStats := c.cpuStats[i] + // If idle jumps backwards by more than X seconds, assume we had a hotplug event and reset the stats for this CPU. - if (c.cpuStats[i].Idle - n.Idle) >= jumpBackSeconds { - level.Debug(c.logger).Log("msg", jumpBackDebugMessage, "cpu", i, "old_value", c.cpuStats[i].Idle, "new_value", n.Idle) - c.cpuStats[i] = procfs.CPUStat{} + if (cpuStats.Idle - n.Idle) >= jumpBackSeconds { + level.Debug(c.logger).Log("msg", jumpBackDebugMessage, "cpu", i, "old_value", cpuStats.Idle, "new_value", n.Idle) + cpuStats = procfs.CPUStat{} } - if n.Idle >= c.cpuStats[i].Idle { - c.cpuStats[i].Idle = n.Idle + if n.Idle >= cpuStats.Idle { + cpuStats.Idle = n.Idle } else { - level.Debug(c.logger).Log("msg", "CPU Idle counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].Idle, "new_value", n.Idle) + level.Debug(c.logger).Log("msg", "CPU Idle counter jumped backwards", "cpu", i, "old_value", cpuStats.Idle, "new_value", n.Idle) } - if n.User >= c.cpuStats[i].User { - c.cpuStats[i].User = n.User + if n.User >= cpuStats.User { + cpuStats.User = n.User } else { - level.Debug(c.logger).Log("msg", "CPU User counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].User, "new_value", n.User) + level.Debug(c.logger).Log("msg", "CPU User counter jumped backwards", "cpu", i, "old_value", cpuStats.User, "new_value", n.User) } - if n.Nice >= c.cpuStats[i].Nice { - c.cpuStats[i].Nice = n.Nice + if n.Nice >= cpuStats.Nice { + cpuStats.Nice = n.Nice } else { - level.Debug(c.logger).Log("msg", "CPU Nice counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].Nice, "new_value", n.Nice) + level.Debug(c.logger).Log("msg", "CPU Nice counter jumped backwards", "cpu", i, "old_value", cpuStats.Nice, "new_value", n.Nice) } - if n.System >= c.cpuStats[i].System { - c.cpuStats[i].System = n.System + if n.System >= cpuStats.System { + cpuStats.System = n.System } else { - level.Debug(c.logger).Log("msg", "CPU System counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].System, "new_value", n.System) + level.Debug(c.logger).Log("msg", "CPU System counter jumped backwards", "cpu", i, "old_value", cpuStats.System, "new_value", n.System) } - if n.Iowait >= c.cpuStats[i].Iowait { - c.cpuStats[i].Iowait = n.Iowait + if n.Iowait >= cpuStats.Iowait { + cpuStats.Iowait = n.Iowait } else { - level.Debug(c.logger).Log("msg", "CPU Iowait counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].Iowait, "new_value", n.Iowait) + level.Debug(c.logger).Log("msg", "CPU Iowait counter jumped backwards", "cpu", i, "old_value", cpuStats.Iowait, "new_value", n.Iowait) } - if n.IRQ >= c.cpuStats[i].IRQ { - c.cpuStats[i].IRQ = n.IRQ + if n.IRQ >= cpuStats.IRQ { + cpuStats.IRQ = n.IRQ } else { - level.Debug(c.logger).Log("msg", "CPU IRQ counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].IRQ, "new_value", n.IRQ) + level.Debug(c.logger).Log("msg", "CPU IRQ counter jumped backwards", "cpu", i, "old_value", cpuStats.IRQ, "new_value", n.IRQ) } - if n.SoftIRQ >= c.cpuStats[i].SoftIRQ { - c.cpuStats[i].SoftIRQ = n.SoftIRQ + if n.SoftIRQ >= cpuStats.SoftIRQ { + cpuStats.SoftIRQ = n.SoftIRQ } else { - level.Debug(c.logger).Log("msg", "CPU SoftIRQ counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].SoftIRQ, "new_value", n.SoftIRQ) + level.Debug(c.logger).Log("msg", "CPU SoftIRQ counter jumped backwards", "cpu", i, "old_value", cpuStats.SoftIRQ, "new_value", n.SoftIRQ) } - if n.Steal >= c.cpuStats[i].Steal { - c.cpuStats[i].Steal = n.Steal + if n.Steal >= cpuStats.Steal { + cpuStats.Steal = n.Steal } else { - level.Debug(c.logger).Log("msg", "CPU Steal counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].Steal, "new_value", n.Steal) + level.Debug(c.logger).Log("msg", "CPU Steal counter jumped backwards", "cpu", i, "old_value", cpuStats.Steal, "new_value", n.Steal) } - if n.Guest >= c.cpuStats[i].Guest { - c.cpuStats[i].Guest = n.Guest + if n.Guest >= cpuStats.Guest { + cpuStats.Guest = n.Guest } else { - level.Debug(c.logger).Log("msg", "CPU Guest counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].Guest, "new_value", n.Guest) + level.Debug(c.logger).Log("msg", "CPU Guest counter jumped backwards", "cpu", i, "old_value", cpuStats.Guest, "new_value", n.Guest) } - if n.GuestNice >= c.cpuStats[i].GuestNice { - c.cpuStats[i].GuestNice = n.GuestNice + if n.GuestNice >= cpuStats.GuestNice { + cpuStats.GuestNice = n.GuestNice } else { - level.Debug(c.logger).Log("msg", "CPU GuestNice counter jumped backwards", "cpu", i, "old_value", c.cpuStats[i].GuestNice, "new_value", n.GuestNice) + level.Debug(c.logger).Log("msg", "CPU GuestNice counter jumped backwards", "cpu", i, "old_value", cpuStats.GuestNice, "new_value", n.GuestNice) } + + c.cpuStats[i] = cpuStats + } + + // Remove offline CPUs. + if len(newStats) != len(c.cpuStats) { + onlineCPUIds := maps.Keys(newStats) + maps.DeleteFunc(c.cpuStats, func(key int64, item procfs.CPUStat) bool { + return !slices.Contains(onlineCPUIds, key) + }) } } diff --git a/collector/cpu_linux_test.go b/collector/cpu_linux_test.go index 93b493b2e9..b148ffcd93 100644 --- a/collector/cpu_linux_test.go +++ b/collector/cpu_linux_test.go @@ -24,9 +24,16 @@ import ( "github.com/prometheus/procfs" ) -func makeTestCPUCollector(s []procfs.CPUStat) *cpuCollector { - dup := make([]procfs.CPUStat, len(s)) - copy(dup, s) +func copyStats(d, s map[int64]procfs.CPUStat) { + for k := range s { + v := s[k] + d[k] = v + } +} + +func makeTestCPUCollector(s map[int64]procfs.CPUStat) *cpuCollector { + dup := make(map[int64]procfs.CPUStat, len(s)) + copyStats(dup, s) return &cpuCollector{ logger: log.NewNopLogger(), cpuStats: dup, @@ -34,32 +41,34 @@ func makeTestCPUCollector(s []procfs.CPUStat) *cpuCollector { } func TestCPU(t *testing.T) { - firstCPUStat := []procfs.CPUStat{{ - User: 100.0, - Nice: 100.0, - System: 100.0, - Idle: 100.0, - Iowait: 100.0, - IRQ: 100.0, - SoftIRQ: 100.0, - Steal: 100.0, - Guest: 100.0, - GuestNice: 100.0, - }} + firstCPUStat := map[int64]procfs.CPUStat{ + 0: { + User: 100.0, + Nice: 100.0, + System: 100.0, + Idle: 100.0, + Iowait: 100.0, + IRQ: 100.0, + SoftIRQ: 100.0, + Steal: 100.0, + Guest: 100.0, + GuestNice: 100.0, + }} c := makeTestCPUCollector(firstCPUStat) - want := []procfs.CPUStat{{ - User: 101.0, - Nice: 101.0, - System: 101.0, - Idle: 101.0, - Iowait: 101.0, - IRQ: 101.0, - SoftIRQ: 101.0, - Steal: 101.0, - Guest: 101.0, - GuestNice: 101.0, - }} + want := map[int64]procfs.CPUStat{ + 0: { + User: 101.0, + Nice: 101.0, + System: 101.0, + Idle: 101.0, + Iowait: 101.0, + IRQ: 101.0, + SoftIRQ: 101.0, + Steal: 101.0, + Guest: 101.0, + GuestNice: 101.0, + }} c.updateCPUStats(want) got := c.cpuStats if !reflect.DeepEqual(want, got) { @@ -67,18 +76,19 @@ func TestCPU(t *testing.T) { } c = makeTestCPUCollector(firstCPUStat) - jumpBack := []procfs.CPUStat{{ - User: 99.9, - Nice: 99.9, - System: 99.9, - Idle: 99.9, - Iowait: 99.9, - IRQ: 99.9, - SoftIRQ: 99.9, - Steal: 99.9, - Guest: 99.9, - GuestNice: 99.9, - }} + jumpBack := map[int64]procfs.CPUStat{ + 0: { + User: 99.9, + Nice: 99.9, + System: 99.9, + Idle: 99.9, + Iowait: 99.9, + IRQ: 99.9, + SoftIRQ: 99.9, + Steal: 99.9, + Guest: 99.9, + GuestNice: 99.9, + }} c.updateCPUStats(jumpBack) got = c.cpuStats if reflect.DeepEqual(jumpBack, got) { @@ -86,21 +96,107 @@ func TestCPU(t *testing.T) { } c = makeTestCPUCollector(firstCPUStat) - resetIdle := []procfs.CPUStat{{ - User: 102.0, - Nice: 102.0, - System: 102.0, - Idle: 1.0, - Iowait: 102.0, - IRQ: 102.0, - SoftIRQ: 102.0, - Steal: 102.0, - Guest: 102.0, - GuestNice: 102.0, - }} + resetIdle := map[int64]procfs.CPUStat{ + 0: { + User: 102.0, + Nice: 102.0, + System: 102.0, + Idle: 1.0, + Iowait: 102.0, + IRQ: 102.0, + SoftIRQ: 102.0, + Steal: 102.0, + Guest: 102.0, + GuestNice: 102.0, + }} c.updateCPUStats(resetIdle) got = c.cpuStats if !reflect.DeepEqual(resetIdle, got) { t.Fatalf("should have %v CPU Stat: got %v", resetIdle, got) } } + +func TestCPUOffline(t *testing.T) { + // CPU 1 goes offline. + firstCPUStat := map[int64]procfs.CPUStat{ + 0: { + User: 100.0, + Nice: 100.0, + System: 100.0, + Idle: 100.0, + Iowait: 100.0, + IRQ: 100.0, + SoftIRQ: 100.0, + Steal: 100.0, + Guest: 100.0, + GuestNice: 100.0, + }, + 1: { + User: 101.0, + Nice: 101.0, + System: 101.0, + Idle: 101.0, + Iowait: 101.0, + IRQ: 101.0, + SoftIRQ: 101.0, + Steal: 101.0, + Guest: 101.0, + GuestNice: 101.0, + }, + } + + c := makeTestCPUCollector(firstCPUStat) + want := map[int64]procfs.CPUStat{ + 0: { + User: 100.0, + Nice: 100.0, + System: 100.0, + Idle: 100.0, + Iowait: 100.0, + IRQ: 100.0, + SoftIRQ: 100.0, + Steal: 100.0, + Guest: 100.0, + GuestNice: 100.0, + }, + } + c.updateCPUStats(want) + got := c.cpuStats + if !reflect.DeepEqual(want, got) { + t.Fatalf("should have %v CPU Stat: got %v", want, got) + } + + // CPU 1 comes back online. + want = map[int64]procfs.CPUStat{ + 0: { + User: 100.0, + Nice: 100.0, + System: 100.0, + Idle: 100.0, + Iowait: 100.0, + IRQ: 100.0, + SoftIRQ: 100.0, + Steal: 100.0, + Guest: 100.0, + GuestNice: 100.0, + }, + 1: { + User: 101.0, + Nice: 101.0, + System: 101.0, + Idle: 101.0, + Iowait: 101.0, + IRQ: 101.0, + SoftIRQ: 101.0, + Steal: 101.0, + Guest: 101.0, + GuestNice: 101.0, + }, + } + c.updateCPUStats(want) + got = c.cpuStats + if !reflect.DeepEqual(want, got) { + t.Fatalf("should have %v CPU Stat: got %v", want, got) + } + +} diff --git a/collector/cpu_netbsd.go b/collector/cpu_netbsd.go new file mode 100644 index 0000000000..7fc95c8081 --- /dev/null +++ b/collector/cpu_netbsd.go @@ -0,0 +1,277 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nocpu +// +build !nocpu + +package collector + +import ( + "errors" + "math" + "regexp" + "sort" + "strconv" + "strings" + "unsafe" + + "github.com/go-kit/log" + "github.com/go-kit/log/level" + "github.com/prometheus/client_golang/prometheus" + "golang.org/x/sys/unix" + + "howett.net/plist" +) + +type clockinfo struct { + hz int32 // clock frequency + tick int32 // micro-seconds per hz tick + spare int32 + stathz int32 // statistics clock frequency + profhz int32 // profiling clock frequency +} + +type cputime struct { + user float64 + nice float64 + sys float64 + intr float64 + idle float64 +} + +type plistref struct { + pref_plist unsafe.Pointer + pref_len uint64 +} + +type sysmonValues struct { + CurValue int `plist:"cur-value"` + Description string `plist:"description"` + State string `plist:"state"` + Type string `plist:"type"` +} + +type sysmonProperty []sysmonValues + +type sysmonProperties map[string]sysmonProperty + +func readBytes(ptr unsafe.Pointer, length uint64) []byte { + buf := make([]byte, length-1) + var i uint64 + for ; i < length-1; i++ { + buf[i] = *(*byte)(unsafe.Pointer(uintptr(ptr) + uintptr(i))) + } + return buf +} + +func ioctl(fd int, nr int64, typ byte, size uintptr, retptr unsafe.Pointer) error { + _, _, errno := unix.Syscall( + unix.SYS_IOCTL, + uintptr(fd), + // Some magicks derived from sys/ioccom.h. + uintptr((0x40000000|0x80000000)| + ((int64(size)&(1<<13-1))<<16)| + (int64(typ)<<8)| + nr, + ), + uintptr(retptr), + ) + if errno != 0 { + return errno + } + return nil +} + +func readSysmonProperties() (sysmonProperties, error) { + fd, err := unix.Open(rootfsFilePath("/dev/sysmon"), unix.O_RDONLY, 0777) + if err != nil { + return nil, err + } + defer unix.Close(fd) + + var retptr plistref + + if err = ioctl(fd, 0, 'E', unsafe.Sizeof(retptr), unsafe.Pointer(&retptr)); err != nil { + return nil, err + } + + bytes := readBytes(retptr.pref_plist, retptr.pref_len) + + var props sysmonProperties + if _, err = plist.Unmarshal(bytes, &props); err != nil { + return nil, err + } + return props, nil +} + +func sortFilterSysmonProperties(props sysmonProperties, prefix string) []string { + var keys []string + for key := range props { + if !strings.HasPrefix(key, prefix) { + continue + } + keys = append(keys, key) + } + sort.Strings(keys) + return keys +} + +func convertTemperatures(prop sysmonProperty, res map[int]float64) error { + + for _, val := range prop { + if val.State == "invalid" || val.State == "unknown" || val.State == "" { + continue + } + + re := regexp.MustCompile("^cpu([0-9]+) temperature$") + core := re.FindStringSubmatch(val.Description)[1] + ncore, _ := strconv.Atoi(core) + temperature := ((float64(uint64(val.CurValue))) / 1000000) - 273.15 + res[ncore] = temperature + } + return nil +} + +func getCPUTemperatures() (map[int]float64, error) { + + res := make(map[int]float64) + + // Read all properties + props, err := readSysmonProperties() + if err != nil { + return res, err + } + + keys := sortFilterSysmonProperties(props, "coretemp") + for idx, _ := range keys { + convertTemperatures(props[keys[idx]], res) + } + + return res, nil +} + +func getCPUTimes() ([]cputime, error) { + const states = 5 + + clockb, err := unix.SysctlRaw("kern.clockrate") + if err != nil { + return nil, err + } + clock := *(*clockinfo)(unsafe.Pointer(&clockb[0])) + + var cpufreq float64 + if clock.stathz > 0 { + cpufreq = float64(clock.stathz) + } else { + cpufreq = float64(clock.hz) + } + + ncpusb, err := unix.SysctlRaw("hw.ncpu") + if err != nil { + return nil, err + } + ncpus := *(*int)(unsafe.Pointer(&ncpusb[0])) + + if ncpus < 1 { + return nil, errors.New("Invalid cpu number") + } + + var times []float64 + for ncpu := 0; ncpu < ncpus; ncpu++ { + cpb, err := unix.SysctlRaw("kern.cp_time", ncpu) + if err != nil { + return nil, err + } + for len(cpb) >= int(unsafe.Sizeof(int(0))) { + t := *(*int)(unsafe.Pointer(&cpb[0])) + times = append(times, float64(t)/cpufreq) + cpb = cpb[unsafe.Sizeof(int(0)):] + } + } + + cpus := make([]cputime, len(times)/states) + for i := 0; i < len(times); i += states { + cpu := &cpus[i/states] + cpu.user = times[i] + cpu.nice = times[i+1] + cpu.sys = times[i+2] + cpu.intr = times[i+3] + cpu.idle = times[i+4] + } + return cpus, nil +} + +type statCollector struct { + cpu typedDesc + temp typedDesc + logger log.Logger +} + +func init() { + registerCollector("cpu", defaultEnabled, NewStatCollector) +} + +// NewStatCollector returns a new Collector exposing CPU stats. +func NewStatCollector(logger log.Logger) (Collector, error) { + return &statCollector{ + cpu: typedDesc{nodeCPUSecondsDesc, prometheus.CounterValue}, + temp: typedDesc{prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "temperature_celsius"), + "CPU temperature", + []string{"cpu"}, nil, + ), prometheus.GaugeValue}, + logger: logger, + }, nil +} + +// Expose CPU stats using sysctl. +func (c *statCollector) Update(ch chan<- prometheus.Metric) error { + // We want time spent per-cpu per CPUSTATE. + // CPUSTATES (number of CPUSTATES) is defined as 5U. + // Order: CP_USER | CP_NICE | CP_SYS | CP_IDLE | CP_INTR + // sysctl kern.cp_time.x provides CPUSTATES long integers: + // (space-separated list of the above variables, where + // x stands for the number of the CPU core) + // + // Each value is a counter incremented at frequency + // kern.clockrate.(stathz | hz) + // + // Look into sys/kern/kern_clock.c for details. + + cpuTimes, err := getCPUTimes() + if err != nil { + return err + } + + cpuTemperatures, err := getCPUTemperatures() + if err != nil { + return err + } + + for cpu, t := range cpuTimes { + lcpu := strconv.Itoa(cpu) + ch <- c.cpu.mustNewConstMetric(float64(t.user), lcpu, "user") + ch <- c.cpu.mustNewConstMetric(float64(t.nice), lcpu, "nice") + ch <- c.cpu.mustNewConstMetric(float64(t.sys), lcpu, "system") + ch <- c.cpu.mustNewConstMetric(float64(t.intr), lcpu, "interrupt") + ch <- c.cpu.mustNewConstMetric(float64(t.idle), lcpu, "idle") + + if temp, ok := cpuTemperatures[cpu]; ok { + ch <- c.temp.mustNewConstMetric(temp, lcpu) + } else { + level.Debug(c.logger).Log("msg", "no temperature information for CPU", "cpu", cpu) + ch <- c.temp.mustNewConstMetric(math.NaN(), lcpu) + } + } + return err +} diff --git a/collector/cpu_netbsd_test.go b/collector/cpu_netbsd_test.go new file mode 100644 index 0000000000..08498d52bf --- /dev/null +++ b/collector/cpu_netbsd_test.go @@ -0,0 +1,44 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nocpu +// +build !nocpu + +package collector + +import ( + "runtime" + "testing" +) + +func TestCPUTimes(t *testing.T) { + times, err := getCPUTimes() + if err != nil { + t.Fatalf("getCPUTimes returned error: %v", err) + } + + if len(times) == 0 { + t.Fatalf("no CPU times found") + } + + if got, want := len(times), runtime.NumCPU(); got != want { + t.Fatalf("unexpected # of CPU times; got %d want %d", got, want) + } +} + +func TestCPUTemperatures(t *testing.T) { + _, err := getCPUTemperatures() + if err != nil { + t.Fatalf("getCPUTemperatures returned error: %v", err) + } +} diff --git a/collector/cpu_openbsd.go b/collector/cpu_openbsd.go index 13ee99acef..8715ff9885 100644 --- a/collector/cpu_openbsd.go +++ b/collector/cpu_openbsd.go @@ -25,14 +25,6 @@ import ( "golang.org/x/sys/unix" ) -type clockinfo struct { - hz int32 - tick int32 - tickadj int32 - stathz int32 - profhz int32 -} - const ( CP_USER = iota CP_NICE @@ -72,8 +64,8 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) (err error) { if err != nil { return err } - clock := *(*clockinfo)(unsafe.Pointer(&clockb[0])) - hz := float64(clock.stathz) + clock := *(*unix.Clockinfo)(unsafe.Pointer(&clockb[0])) + hz := float64(clock.Stathz) ncpus, err := unix.SysctlUint32("hw.ncpu") if err != nil { diff --git a/collector/cpu_solaris.go b/collector/cpu_solaris.go index c28b4d6dfc..c78845423f 100644 --- a/collector/cpu_solaris.go +++ b/collector/cpu_solaris.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build solaris && !nocpu -// +build solaris,!nocpu +//go:build !nocpu +// +build !nocpu package collector @@ -60,17 +60,17 @@ func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error { } for k, v := range map[string]string{ - "idle": "cpu_ticks_idle", - "kernel": "cpu_ticks_kernel", - "user": "cpu_ticks_user", - "wait": "cpu_ticks_wait", + "idle": "cpu_nsec_idle", + "kernel": "cpu_nsec_kernel", + "user": "cpu_nsec_user", + "wait": "cpu_nsec_wait", } { kstatValue, err := ksCPU.GetNamed(v) if err != nil { return err } - ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal), strconv.Itoa(cpu), k) + ch <- c.cpu.mustNewConstMetric(float64(kstatValue.UintVal)/1e9, strconv.Itoa(cpu), k) } } return nil diff --git a/collector/cpu_vulnerabilities_linux.go b/collector/cpu_vulnerabilities_linux.go new file mode 100644 index 0000000000..69a2c587e3 --- /dev/null +++ b/collector/cpu_vulnerabilities_linux.go @@ -0,0 +1,69 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package collector + +import ( + "fmt" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs/sysfs" +) + +const ( + cpuVulerabilitiesCollector = "cpu_vulnerabilities" +) + +var ( + vulnerabilityDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuVulerabilitiesCollector, "info"), + "Details of each CPU vulnerability reported by sysfs. The value of the series is an int encoded state of the vulnerability. The same state is stored as a string in the label", + []string{"codename", "state", "mitigation"}, + nil, + ) +) + +type cpuVulnerabilitiesCollector struct{} + +func init() { + registerCollector(cpuVulerabilitiesCollector, defaultDisabled, NewVulnerabilitySysfsCollector) +} + +func NewVulnerabilitySysfsCollector(logger log.Logger) (Collector, error) { + return &cpuVulnerabilitiesCollector{}, nil +} + +func (v *cpuVulnerabilitiesCollector) Update(ch chan<- prometheus.Metric) error { + fs, err := sysfs.NewFS(*sysPath) + if err != nil { + return fmt.Errorf("failed to open sysfs: %w", err) + } + + vulnerabilities, err := fs.CPUVulnerabilities() + if err != nil { + return fmt.Errorf("failed to get vulnerabilities: %w", err) + } + + for _, vulnerability := range vulnerabilities { + ch <- prometheus.MustNewConstMetric( + vulnerabilityDesc, + prometheus.GaugeValue, + 1.0, + vulnerability.CodeName, + sysfs.VulnerabilityHumanEncoding[vulnerability.State], + vulnerability.Mitigation, + ) + } + return nil +} diff --git a/collector/cpufreq_common.go b/collector/cpufreq_common.go new file mode 100644 index 0000000000..e1eda58947 --- /dev/null +++ b/collector/cpufreq_common.go @@ -0,0 +1,59 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nocpu +// +build !nocpu + +package collector + +import ( + "github.com/prometheus/client_golang/prometheus" +) + +var ( + cpuFreqHertzDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), + "Current CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqMinDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_min_hertz"), + "Minimum CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqMaxDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_max_hertz"), + "Maximum CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqScalingFreqDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_hertz"), + "Current scaled CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqScalingFreqMinDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_min_hertz"), + "Minimum scaled CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqScalingFreqMaxDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_max_hertz"), + "Maximum scaled CPU thread frequency in hertz.", + []string{"cpu"}, nil, + ) + cpuFreqScalingGovernorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_governor"), + "Current enabled CPU frequency governor.", + []string{"cpu", "governor"}, nil, + ) +) diff --git a/collector/cpufreq_linux.go b/collector/cpufreq_linux.go index ce431cc06e..3372be1ab6 100644 --- a/collector/cpufreq_linux.go +++ b/collector/cpufreq_linux.go @@ -18,21 +18,15 @@ package collector import ( "fmt" - "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" + "strings" ) type cpuFreqCollector struct { - fs sysfs.FS - cpuFreq *prometheus.Desc - cpuFreqMin *prometheus.Desc - cpuFreqMax *prometheus.Desc - scalingFreq *prometheus.Desc - scalingFreqMin *prometheus.Desc - scalingFreqMax *prometheus.Desc - logger log.Logger + fs sysfs.FS + logger log.Logger } func init() { @@ -47,37 +41,7 @@ func NewCPUFreqCollector(logger log.Logger) (Collector, error) { } return &cpuFreqCollector{ - fs: fs, - cpuFreq: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), - "Current cpu thread frequency in hertz.", - []string{"cpu"}, nil, - ), - cpuFreqMin: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_min_hertz"), - "Minimum cpu thread frequency in hertz.", - []string{"cpu"}, nil, - ), - cpuFreqMax: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_max_hertz"), - "Maximum cpu thread frequency in hertz.", - []string{"cpu"}, nil, - ), - scalingFreq: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_hertz"), - "Current scaled CPU thread frequency in hertz.", - []string{"cpu"}, nil, - ), - scalingFreqMin: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_min_hertz"), - "Minimum scaled CPU thread frequency in hertz.", - []string{"cpu"}, nil, - ), - scalingFreqMax: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "scaling_frequency_max_hertz"), - "Maximum scaled CPU thread frequency in hertz.", - []string{"cpu"}, nil, - ), + fs: fs, logger: logger, }, nil } @@ -94,7 +58,7 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { for _, stats := range cpuFreqs { if stats.CpuinfoCurrentFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.cpuFreq, + cpuFreqHertzDesc, prometheus.GaugeValue, float64(*stats.CpuinfoCurrentFrequency)*1000.0, stats.Name, @@ -102,7 +66,7 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { } if stats.CpuinfoMinimumFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.cpuFreqMin, + cpuFreqMinDesc, prometheus.GaugeValue, float64(*stats.CpuinfoMinimumFrequency)*1000.0, stats.Name, @@ -110,7 +74,7 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { } if stats.CpuinfoMaximumFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.cpuFreqMax, + cpuFreqMaxDesc, prometheus.GaugeValue, float64(*stats.CpuinfoMaximumFrequency)*1000.0, stats.Name, @@ -118,7 +82,7 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { } if stats.ScalingCurrentFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.scalingFreq, + cpuFreqScalingFreqDesc, prometheus.GaugeValue, float64(*stats.ScalingCurrentFrequency)*1000.0, stats.Name, @@ -126,7 +90,7 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { } if stats.ScalingMinimumFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.scalingFreqMin, + cpuFreqScalingFreqMinDesc, prometheus.GaugeValue, float64(*stats.ScalingMinimumFrequency)*1000.0, stats.Name, @@ -134,12 +98,28 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { } if stats.ScalingMaximumFrequency != nil { ch <- prometheus.MustNewConstMetric( - c.scalingFreqMax, + cpuFreqScalingFreqMaxDesc, prometheus.GaugeValue, float64(*stats.ScalingMaximumFrequency)*1000.0, stats.Name, ) } + if stats.Governor != "" { + availableGovernors := strings.Split(stats.AvailableGovernors, " ") + for _, g := range availableGovernors { + state := 0 + if g == stats.Governor { + state = 1 + } + ch <- prometheus.MustNewConstMetric( + cpuFreqScalingGovernorDesc, + prometheus.GaugeValue, + float64(state), + stats.Name, + g, + ) + } + } } return nil } diff --git a/collector/cpufreq_solaris.go b/collector/cpufreq_solaris.go index 10883ce404..c3fb9ee687 100644 --- a/collector/cpufreq_solaris.go +++ b/collector/cpufreq_solaris.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build solaris && !nocpu -// +build solaris,!nocpu +//go:build !nocpu +// +build !nocpu package collector @@ -29,9 +29,7 @@ import ( import "C" type cpuFreqCollector struct { - cpuFreq *prometheus.Desc - cpuFreqMax *prometheus.Desc - logger log.Logger + logger log.Logger } func init() { @@ -40,16 +38,6 @@ func init() { func NewCpuFreqCollector(logger log.Logger) (Collector, error) { return &cpuFreqCollector{ - cpuFreq: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"), - "Current CPU thread frequency in hertz.", - []string{"cpu"}, nil, - ), - cpuFreqMax: prometheus.NewDesc( - prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_max_hertz"), - "Maximum CPU thread frequency in hertz.", - []string{"cpu"}, nil, - ), logger: logger, }, nil } @@ -81,14 +69,14 @@ func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error { lcpu := strconv.Itoa(cpu) ch <- prometheus.MustNewConstMetric( - c.cpuFreq, + cpuFreqHertzDesc, prometheus.GaugeValue, float64(cpuFreqV.UintVal), lcpu, ) // Multiply by 1e+6 to convert MHz to Hz. ch <- prometheus.MustNewConstMetric( - c.cpuFreqMax, + cpuFreqMaxDesc, prometheus.GaugeValue, float64(cpuFreqMaxV.IntVal)*1e+6, lcpu, diff --git a/collector/device_filter.go b/collector/device_filter.go index 3e4bb5fee0..d8a38a2970 100644 --- a/collector/device_filter.go +++ b/collector/device_filter.go @@ -34,8 +34,8 @@ func newDeviceFilter(ignoredPattern, acceptPattern string) (f deviceFilter) { return } -// ignores returns whether the device should be ignored +// ignored returns whether the device should be ignored func (f *deviceFilter) ignored(name string) bool { - return ((f.ignorePattern != nil && f.ignorePattern.MatchString(name)) || - (f.acceptPattern != nil && !f.acceptPattern.MatchString(name))) + return (f.ignorePattern != nil && f.ignorePattern.MatchString(name)) || + (f.acceptPattern != nil && !f.acceptPattern.MatchString(name)) } diff --git a/collector/diskstats_common.go b/collector/diskstats_common.go index 6d1f33615c..2ab84438e7 100644 --- a/collector/diskstats_common.go +++ b/collector/diskstats_common.go @@ -20,10 +20,10 @@ package collector import ( "errors" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -33,9 +33,20 @@ const ( var ( diskLabelNames = []string{"device"} - diskstatsDeviceExclude = kingpin.Flag("collector.diskstats.device-exclude", "Regexp of diskstats devices to exclude (mutually exclusive to device-include).").Default(diskstatsDefaultIgnoredDevices).String() - oldDiskstatsDeviceExclude = kingpin.Flag("collector.diskstats.ignored-devices", "DEPRECATED: Use collector.diskstats.device-exclude").String() - diskstatsDeviceInclude = kingpin.Flag("collector.diskstats.device-include", "Regexp of diskstats devices to include (mutually exclusive to device-exclude).").String() + diskstatsDeviceExcludeSet bool + diskstatsDeviceExclude = kingpin.Flag( + "collector.diskstats.device-exclude", + "Regexp of diskstats devices to exclude (mutually exclusive to device-include).", + ).Default(diskstatsDefaultIgnoredDevices).PreAction(func(c *kingpin.ParseContext) error { + diskstatsDeviceExcludeSet = true + return nil + }).String() + oldDiskstatsDeviceExclude = kingpin.Flag( + "collector.diskstats.ignored-devices", + "DEPRECATED: Use collector.diskstats.device-exclude", + ).Hidden().String() + + diskstatsDeviceInclude = kingpin.Flag("collector.diskstats.device-include", "Regexp of diskstats devices to include (mutually exclusive to device-exclude).").String() readsCompletedDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, diskSubsystem, "reads_completed_total"), @@ -84,7 +95,7 @@ var ( func newDiskstatsDeviceFilter(logger log.Logger) (deviceFilter, error) { if *oldDiskstatsDeviceExclude != "" { - if *diskstatsDeviceExclude == "" { + if !diskstatsDeviceExcludeSet { level.Warn(logger).Log("msg", "--collector.diskstats.ignored-devices is DEPRECATED and will be removed in 2.0.0, use --collector.diskstats.device-exclude") *diskstatsDeviceExclude = *oldDiskstatsDeviceExclude } else { diff --git a/collector/diskstats_linux.go b/collector/diskstats_linux.go index d7a4287e1e..ed5d044a61 100644 --- a/collector/diskstats_linux.go +++ b/collector/diskstats_linux.go @@ -36,7 +36,7 @@ const ( // See also https://www.kernel.org/doc/Documentation/block/stat.txt unixSectorSize = 512.0 - diskstatsDefaultIgnoredDevices = "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" + diskstatsDefaultIgnoredDevices = "^(z?ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" // See udevadm(8). udevDevicePropertyPrefix = "E:" @@ -63,6 +63,7 @@ const ( udevIDRevision = "ID_REVISION" udevIDSerialShort = "ID_SERIAL_SHORT" udevIDWWN = "ID_WWN" + udevSCSIIdentSerial = "SCSI_IDENT_SERIAL" ) type typedFactorDesc struct { @@ -286,13 +287,21 @@ func (c *diskstatsCollector) Update(ch chan<- prometheus.Metric) error { level.Debug(c.logger).Log("msg", "Failed to parse udev info", "err", err) } + // This is usually the serial printed on the disk label. + serial := info[udevSCSIIdentSerial] + + // If it's undefined, fallback to ID_SERIAL_SHORT instead. + if serial == "" { + serial = info[udevIDSerialShort] + } + ch <- c.infoDesc.mustNewConstMetric(1.0, dev, fmt.Sprint(stats.MajorNumber), fmt.Sprint(stats.MinorNumber), info[udevIDPath], info[udevIDWWN], info[udevIDModel], - info[udevIDSerialShort], + serial, info[udevIDRevision], ) diff --git a/collector/diskstats_linux_test.go b/collector/diskstats_linux_test.go index 526b25d69e..8e969c3e3a 100644 --- a/collector/diskstats_linux_test.go +++ b/collector/diskstats_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nodiskstats +// +build !nodiskstats + package collector import ( @@ -50,7 +53,7 @@ func TestDiskStats(t *testing.T) { *sysPath = "fixtures/sys" *procPath = "fixtures/proc" *udevDataPath = "fixtures/udev/data" - *diskstatsDeviceExclude = "^(ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" + *diskstatsDeviceExclude = "^(z?ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" testcase := `# HELP node_disk_ata_rotation_rate_rpm ATA disk rotation rate in RPMs (0 for SSDs). # TYPE node_disk_ata_rotation_rate_rpm gauge node_disk_ata_rotation_rate_rpm{device="sda"} 7200 diff --git a/collector/diskstats_openbsd.go b/collector/diskstats_openbsd.go index 46d9bc1a34..2a69042aac 100644 --- a/collector/diskstats_openbsd.go +++ b/collector/diskstats_openbsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build openbsd && !amd64 && !nodiskstats -// +build openbsd,!amd64,!nodiskstats +//go:build !nodiskstats && !amd64 +// +build !nodiskstats,!amd64 package collector diff --git a/collector/ethtool_linux.go b/collector/ethtool_linux.go index e4f05a6f5a..7412c27c37 100644 --- a/collector/ethtool_linux.go +++ b/collector/ethtool_linux.go @@ -30,13 +30,13 @@ import ( "sync" "syscall" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" "github.com/safchain/ethtool" "golang.org/x/sys/unix" - "gopkg.in/alecthomas/kingpin.v2" ) var ( @@ -276,29 +276,84 @@ func (c *ethtoolCollector) updateSpeeds(ch chan<- prometheus.Metric, prefix stri duplex string phy string }{ - unix.ETHTOOL_LINK_MODE_10baseT_Half_BIT: {10, half, "T"}, - unix.ETHTOOL_LINK_MODE_10baseT_Full_BIT: {10, full, "T"}, - unix.ETHTOOL_LINK_MODE_100baseT_Half_BIT: {100, half, "T"}, - unix.ETHTOOL_LINK_MODE_100baseT_Full_BIT: {100, full, "T"}, - unix.ETHTOOL_LINK_MODE_1000baseT_Half_BIT: {1000, half, "T"}, - unix.ETHTOOL_LINK_MODE_1000baseT_Full_BIT: {1000, full, "T"}, - unix.ETHTOOL_LINK_MODE_10000baseT_Full_BIT: {10000, full, "T"}, - unix.ETHTOOL_LINK_MODE_2500baseT_Full_BIT: {2500, full, "T"}, - unix.ETHTOOL_LINK_MODE_1000baseKX_Full_BIT: {1000, full, "KX"}, - unix.ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT: {10000, full, "KX4"}, - unix.ETHTOOL_LINK_MODE_10000baseKR_Full_BIT: {10000, full, "KR"}, - unix.ETHTOOL_LINK_MODE_10000baseR_FEC_BIT: {10000, full, "R_FEC"}, - unix.ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT: {20000, full, "MLD2"}, - unix.ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT: {20000, full, "KR2"}, - unix.ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT: {40000, full, "KR4"}, - unix.ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT: {40000, full, "CR4"}, - unix.ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT: {40000, full, "SR4"}, - unix.ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT: {40000, full, "LR4"}, - unix.ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT: {56000, full, "KR4"}, - unix.ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT: {56000, full, "CR4"}, - unix.ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT: {56000, full, "SR4"}, - unix.ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT: {56000, full, "LR4"}, - unix.ETHTOOL_LINK_MODE_25000baseCR_Full_BIT: {25000, full, "CR"}, + unix.ETHTOOL_LINK_MODE_10baseT_Half_BIT: {10, half, "T"}, + unix.ETHTOOL_LINK_MODE_10baseT_Full_BIT: {10, full, "T"}, + unix.ETHTOOL_LINK_MODE_100baseT_Half_BIT: {100, half, "T"}, + unix.ETHTOOL_LINK_MODE_100baseT_Full_BIT: {100, full, "T"}, + unix.ETHTOOL_LINK_MODE_1000baseT_Half_BIT: {1000, half, "T"}, + unix.ETHTOOL_LINK_MODE_1000baseT_Full_BIT: {1000, full, "T"}, + unix.ETHTOOL_LINK_MODE_10000baseT_Full_BIT: {10000, full, "T"}, + unix.ETHTOOL_LINK_MODE_2500baseT_Full_BIT: {2500, full, "T"}, + unix.ETHTOOL_LINK_MODE_1000baseKX_Full_BIT: {1000, full, "KX"}, + unix.ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT: {10000, full, "KX4"}, + unix.ETHTOOL_LINK_MODE_10000baseKR_Full_BIT: {10000, full, "KR"}, + unix.ETHTOOL_LINK_MODE_10000baseR_FEC_BIT: {10000, full, "R_FEC"}, + unix.ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT: {20000, full, "MLD2"}, + unix.ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT: {20000, full, "KR2"}, + unix.ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT: {40000, full, "KR4"}, + unix.ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT: {40000, full, "CR4"}, + unix.ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT: {40000, full, "SR4"}, + unix.ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT: {40000, full, "LR4"}, + unix.ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT: {56000, full, "KR4"}, + unix.ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT: {56000, full, "CR4"}, + unix.ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT: {56000, full, "SR4"}, + unix.ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT: {56000, full, "LR4"}, + unix.ETHTOOL_LINK_MODE_25000baseCR_Full_BIT: {25000, full, "CR"}, + unix.ETHTOOL_LINK_MODE_25000baseKR_Full_BIT: {25000, full, "KR"}, + unix.ETHTOOL_LINK_MODE_25000baseSR_Full_BIT: {25000, full, "SR"}, + unix.ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT: {50000, full, "CR2"}, + unix.ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT: {50000, full, "KR2"}, + unix.ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT: {100000, full, "KR4"}, + unix.ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT: {100000, full, "SR4"}, + unix.ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT: {100000, full, "CR4"}, + unix.ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT: {100000, full, "R4_ER4"}, + unix.ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT: {50000, full, "SR2"}, + unix.ETHTOOL_LINK_MODE_1000baseX_Full_BIT: {1000, full, "X"}, + unix.ETHTOOL_LINK_MODE_10000baseCR_Full_BIT: {10000, full, "CR"}, + unix.ETHTOOL_LINK_MODE_10000baseSR_Full_BIT: {10000, full, "SR"}, + unix.ETHTOOL_LINK_MODE_10000baseLR_Full_BIT: {10000, full, "LR"}, + unix.ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT: {10000, full, "LRM"}, + unix.ETHTOOL_LINK_MODE_10000baseER_Full_BIT: {10000, full, "ER"}, + unix.ETHTOOL_LINK_MODE_5000baseT_Full_BIT: {5000, full, "T"}, + unix.ETHTOOL_LINK_MODE_50000baseKR_Full_BIT: {50000, full, "KR"}, + unix.ETHTOOL_LINK_MODE_50000baseSR_Full_BIT: {50000, full, "SR"}, + unix.ETHTOOL_LINK_MODE_50000baseCR_Full_BIT: {50000, full, "CR"}, + unix.ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT: {50000, full, "LR_ER_FR"}, + unix.ETHTOOL_LINK_MODE_50000baseDR_Full_BIT: {50000, full, "DR"}, + unix.ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT: {100000, full, "KR2"}, + unix.ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT: {100000, full, "SR2"}, + unix.ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT: {100000, full, "CR2"}, + unix.ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT: {100000, full, "LR2_ER2_FR2"}, + unix.ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT: {100000, full, "DR2"}, + unix.ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT: {200000, full, "KR4"}, + unix.ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT: {200000, full, "SR4"}, + unix.ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT: {200000, full, "LR4_ER4_FR4"}, + unix.ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT: {200000, full, "DR4"}, + unix.ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT: {200000, full, "CR4"}, + unix.ETHTOOL_LINK_MODE_100baseT1_Full_BIT: {100, full, "T1"}, + unix.ETHTOOL_LINK_MODE_1000baseT1_Full_BIT: {1000, full, "T1"}, + unix.ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT: {400000, full, "KR8"}, + unix.ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT: {400000, full, "SR8"}, + unix.ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT: {400000, full, "LR8_ER8_FR8"}, + unix.ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT: {400000, full, "DR8"}, + unix.ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT: {400000, full, "CR8"}, + unix.ETHTOOL_LINK_MODE_100000baseKR_Full_BIT: {100000, full, "KR"}, + unix.ETHTOOL_LINK_MODE_100000baseSR_Full_BIT: {100000, full, "SR"}, + unix.ETHTOOL_LINK_MODE_100000baseLR_ER_FR_Full_BIT: {100000, full, "LR_ER_FR"}, + unix.ETHTOOL_LINK_MODE_100000baseCR_Full_BIT: {100000, full, "CR"}, + unix.ETHTOOL_LINK_MODE_100000baseDR_Full_BIT: {100000, full, "DR"}, + unix.ETHTOOL_LINK_MODE_200000baseKR2_Full_BIT: {200000, full, "KR2"}, + unix.ETHTOOL_LINK_MODE_200000baseSR2_Full_BIT: {200000, full, "SR2"}, + unix.ETHTOOL_LINK_MODE_200000baseLR2_ER2_FR2_Full_BIT: {200000, full, "LR2_ER2_FR2"}, + unix.ETHTOOL_LINK_MODE_200000baseDR2_Full_BIT: {200000, full, "DR2"}, + unix.ETHTOOL_LINK_MODE_200000baseCR2_Full_BIT: {200000, full, "CR2"}, + unix.ETHTOOL_LINK_MODE_400000baseKR4_Full_BIT: {400000, full, "KR4"}, + unix.ETHTOOL_LINK_MODE_400000baseSR4_Full_BIT: {400000, full, "SR4"}, + unix.ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT: {400000, full, "LR4_ER4_FR4"}, + unix.ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT: {400000, full, "DR4"}, + unix.ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT: {400000, full, "CR4"}, + unix.ETHTOOL_LINK_MODE_100baseFX_Half_BIT: {100, half, "FX"}, + unix.ETHTOOL_LINK_MODE_100baseFX_Full_BIT: {100, full, "FX"}, } { if linkModes&(1< 0 { continue } ch <- prometheus.MustNewConstMetric( c.sizeDesc, prometheus.GaugeValue, - s.size, s.labels.device, s.labels.mountPoint, s.labels.fsType, + s.size, s.labels.device, s.labels.mountPoint, s.labels.fsType, s.labels.deviceError, ) ch <- prometheus.MustNewConstMetric( c.freeDesc, prometheus.GaugeValue, - s.free, s.labels.device, s.labels.mountPoint, s.labels.fsType, + s.free, s.labels.device, s.labels.mountPoint, s.labels.fsType, s.labels.deviceError, ) ch <- prometheus.MustNewConstMetric( c.availDesc, prometheus.GaugeValue, - s.avail, s.labels.device, s.labels.mountPoint, s.labels.fsType, + s.avail, s.labels.device, s.labels.mountPoint, s.labels.fsType, s.labels.deviceError, ) ch <- prometheus.MustNewConstMetric( c.filesDesc, prometheus.GaugeValue, - s.files, s.labels.device, s.labels.mountPoint, s.labels.fsType, + s.files, s.labels.device, s.labels.mountPoint, s.labels.fsType, s.labels.deviceError, ) ch <- prometheus.MustNewConstMetric( c.filesFreeDesc, prometheus.GaugeValue, - s.filesFree, s.labels.device, s.labels.mountPoint, s.labels.fsType, - ) - ch <- prometheus.MustNewConstMetric( - c.roDesc, prometheus.GaugeValue, - s.ro, s.labels.device, s.labels.mountPoint, s.labels.fsType, + s.filesFree, s.labels.device, s.labels.mountPoint, s.labels.fsType, s.labels.deviceError, ) } return nil diff --git a/collector/filesystem_linux.go b/collector/filesystem_linux.go index 19ad8145d8..1d0c8493b9 100644 --- a/collector/filesystem_linux.go +++ b/collector/filesystem_linux.go @@ -26,10 +26,10 @@ import ( "sync" "time" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "golang.org/x/sys/unix" - "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -40,6 +40,9 @@ const ( var mountTimeout = kingpin.Flag("collector.filesystem.mount-timeout", "how long to wait for a mount to respond before marking it as stale"). Hidden().Default("5s").Duration() +var statWorkerCount = kingpin.Flag("collector.filesystem.stat-workers", + "how many stat calls to process simultaneously"). + Hidden().Default("4").Int() var stuckMounts = make(map[string]struct{}) var stuckMountsMtx = &sync.Mutex{} @@ -50,72 +53,105 @@ func (c *filesystemCollector) GetStats() ([]filesystemStats, error) { return nil, err } stats := []filesystemStats{} - for _, labels := range mps { - if c.excludedMountPointsPattern.MatchString(labels.mountPoint) { - level.Debug(c.logger).Log("msg", "Ignoring mount point", "mountpoint", labels.mountPoint) - continue - } - if c.excludedFSTypesPattern.MatchString(labels.fsType) { - level.Debug(c.logger).Log("msg", "Ignoring fs", "type", labels.fsType) - continue - } - stuckMountsMtx.Lock() - if _, ok := stuckMounts[labels.mountPoint]; ok { - stats = append(stats, filesystemStats{ - labels: labels, - deviceError: 1, - }) - level.Debug(c.logger).Log("msg", "Mount point is in an unresponsive state", "mountpoint", labels.mountPoint) + labelChan := make(chan filesystemLabels) + statChan := make(chan filesystemStats) + wg := sync.WaitGroup{} + + workerCount := *statWorkerCount + if workerCount < 1 { + workerCount = 1 + } + + for i := 0; i < workerCount; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for labels := range labelChan { + statChan <- c.processStat(labels) + } + }() + } + + go func() { + for _, labels := range mps { + if c.excludedMountPointsPattern.MatchString(labels.mountPoint) { + level.Debug(c.logger).Log("msg", "Ignoring mount point", "mountpoint", labels.mountPoint) + continue + } + if c.excludedFSTypesPattern.MatchString(labels.fsType) { + level.Debug(c.logger).Log("msg", "Ignoring fs", "type", labels.fsType) + continue + } + + stuckMountsMtx.Lock() + if _, ok := stuckMounts[labels.mountPoint]; ok { + labels.deviceError = "mountpoint timeout" + stats = append(stats, filesystemStats{ + labels: labels, + deviceError: 1, + }) + level.Debug(c.logger).Log("msg", "Mount point is in an unresponsive state", "mountpoint", labels.mountPoint) + stuckMountsMtx.Unlock() + continue + } + stuckMountsMtx.Unlock() - continue + labelChan <- labels } - stuckMountsMtx.Unlock() + close(labelChan) + wg.Wait() + close(statChan) + }() - // The success channel is used do tell the "watcher" that the stat - // finished successfully. The channel is closed on success. - success := make(chan struct{}) - go stuckMountWatcher(labels.mountPoint, success, c.logger) + for stat := range statChan { + stats = append(stats, stat) + } + return stats, nil +} - buf := new(unix.Statfs_t) - err = unix.Statfs(rootfsFilePath(labels.mountPoint), buf) - stuckMountsMtx.Lock() - close(success) - // If the mount has been marked as stuck, unmark it and log it's recovery. - if _, ok := stuckMounts[labels.mountPoint]; ok { - level.Debug(c.logger).Log("msg", "Mount point has recovered, monitoring will resume", "mountpoint", labels.mountPoint) - delete(stuckMounts, labels.mountPoint) +func (c *filesystemCollector) processStat(labels filesystemLabels) filesystemStats { + var ro float64 + for _, option := range strings.Split(labels.options, ",") { + if option == "ro" { + ro = 1 + break } - stuckMountsMtx.Unlock() + } - if err != nil { - stats = append(stats, filesystemStats{ - labels: labels, - deviceError: 1, - }) + success := make(chan struct{}) + go stuckMountWatcher(labels.mountPoint, success, c.logger) - level.Debug(c.logger).Log("msg", "Error on statfs() system call", "rootfs", rootfsFilePath(labels.mountPoint), "err", err) - continue - } + buf := new(unix.Statfs_t) + err := unix.Statfs(rootfsFilePath(labels.mountPoint), buf) + stuckMountsMtx.Lock() + close(success) - var ro float64 - for _, option := range strings.Split(labels.options, ",") { - if option == "ro" { - ro = 1 - break - } + // If the mount has been marked as stuck, unmark it and log it's recovery. + if _, ok := stuckMounts[labels.mountPoint]; ok { + level.Debug(c.logger).Log("msg", "Mount point has recovered, monitoring will resume", "mountpoint", labels.mountPoint) + delete(stuckMounts, labels.mountPoint) + } + stuckMountsMtx.Unlock() + + if err != nil { + labels.deviceError = err.Error() + level.Debug(c.logger).Log("msg", "Error on statfs() system call", "rootfs", rootfsFilePath(labels.mountPoint), "err", err) + return filesystemStats{ + labels: labels, + deviceError: 1, + ro: ro, } + } - stats = append(stats, filesystemStats{ - labels: labels, - size: float64(buf.Blocks) * float64(buf.Bsize), - free: float64(buf.Bfree) * float64(buf.Bsize), - avail: float64(buf.Bavail) * float64(buf.Bsize), - files: float64(buf.Files), - filesFree: float64(buf.Ffree), - ro: ro, - }) + return filesystemStats{ + labels: labels, + size: float64(buf.Blocks) * float64(buf.Bsize), + free: float64(buf.Bfree) * float64(buf.Bsize), + avail: float64(buf.Bavail) * float64(buf.Bsize), + files: float64(buf.Files), + filesFree: float64(buf.Ffree), + ro: ro, } - return stats, nil } // stuckMountWatcher listens on the given success channel and if the channel closes @@ -173,10 +209,11 @@ func parseFilesystemLabels(r io.Reader) ([]filesystemLabels, error) { parts[1] = strings.Replace(parts[1], "\\011", "\t", -1) filesystems = append(filesystems, filesystemLabels{ - device: parts[0], - mountPoint: rootfsStripPrefix(parts[1]), - fsType: parts[2], - options: parts[3], + device: parts[0], + mountPoint: rootfsStripPrefix(parts[1]), + fsType: parts[2], + options: parts[3], + deviceError: "", }) } diff --git a/collector/filesystem_linux_test.go b/collector/filesystem_linux_test.go index 1d18fd5920..325ffc87b2 100644 --- a/collector/filesystem_linux_test.go +++ b/collector/filesystem_linux_test.go @@ -11,14 +11,17 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nofilesystem +// +build !nofilesystem + package collector import ( - "github.com/go-kit/log" "strings" "testing" - kingpin "gopkg.in/alecthomas/kingpin.v2" + "github.com/alecthomas/kingpin/v2" + "github.com/go-kit/log" ) func Test_parseFilesystemLabelsError(t *testing.T) { diff --git a/collector/filesystem_openbsd_amd64.go b/collector/filesystem_openbsd.go similarity index 90% rename from collector/filesystem_openbsd_amd64.go rename to collector/filesystem_openbsd.go index 75fc844053..1c1e479e1f 100644 --- a/collector/filesystem_openbsd_amd64.go +++ b/collector/filesystem_openbsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build openbsd && !nofilesystem -// +build openbsd,!nofilesystem +//go:build !nofilesystem +// +build !nofilesystem package collector @@ -41,14 +41,14 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) { stats = []filesystemStats{} for _, v := range mnt { - mountpoint := string(v.F_mntonname[:]) + mountpoint := unix.ByteSliceToString(v.F_mntonname[:]) if c.excludedMountPointsPattern.MatchString(mountpoint) { level.Debug(c.logger).Log("msg", "Ignoring mount point", "mountpoint", mountpoint) continue } - device := string(v.F_mntfromname[:]) - fstype := string(v.F_fstypename[:]) + device := unix.ByteSliceToString(v.F_mntfromname[:]) + fstype := unix.ByteSliceToString(v.F_fstypename[:]) if c.excludedFSTypesPattern.MatchString(fstype) { level.Debug(c.logger).Log("msg", "Ignoring fs type", "type", fstype) continue diff --git a/collector/fixtures/e2e-64k-page-output.txt b/collector/fixtures/e2e-64k-page-output.txt index f803dbb3f6..99c58abaf7 100644 --- a/collector/fixtures/e2e-64k-page-output.txt +++ b/collector/fixtures/e2e-64k-page-output.txt @@ -97,7 +97,7 @@ node_bcache_cache_misses_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-8 node_bcache_cache_read_races_total{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_readaheads_total Count of times readahead occurred. # TYPE node_bcache_cache_readaheads_total counter -node_bcache_cache_readaheads_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 +node_bcache_cache_readaheads_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 13 # HELP node_bcache_congested Congestion. # TYPE node_bcache_congested gauge node_bcache_congested{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 @@ -326,6 +326,16 @@ node_cpu_scaling_frequency_min_hertz{cpu="0"} 8e+08 node_cpu_scaling_frequency_min_hertz{cpu="1"} 8e+08 node_cpu_scaling_frequency_min_hertz{cpu="2"} 1e+06 node_cpu_scaling_frequency_min_hertz{cpu="3"} 1e+06 +# HELP node_cpu_scaling_governor Current enabled CPU frequency governor. +# TYPE node_cpu_scaling_governor gauge +node_cpu_scaling_governor{cpu="0",governor="performance"} 0 +node_cpu_scaling_governor{cpu="0",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="1",governor="performance"} 0 +node_cpu_scaling_governor{cpu="1",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="2",governor="performance"} 0 +node_cpu_scaling_governor{cpu="2",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="3",governor="performance"} 0 +node_cpu_scaling_governor{cpu="3",governor="powersave"} 1 # HELP node_cpu_seconds_total Seconds the CPUs spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69 @@ -392,6 +402,13 @@ node_cpu_seconds_total{cpu="7",mode="softirq"} 0.31 node_cpu_seconds_total{cpu="7",mode="steal"} 0 node_cpu_seconds_total{cpu="7",mode="system"} 101.64 node_cpu_seconds_total{cpu="7",mode="user"} 290.98 +# HELP node_cpu_vulnerabilities_info Details of each CPU vulnerability reported by sysfs. The value of the series is an int encoded state of the vulnerability. The same state is stored as a string in the label +# TYPE node_cpu_vulnerabilities_info gauge +node_cpu_vulnerabilities_info{codename="itlb_multihit",mitigation="",state="not affected"} 1 +node_cpu_vulnerabilities_info{codename="mds",mitigation="",state="vulnerable"} 1 +node_cpu_vulnerabilities_info{codename="retbleed",mitigation="untrained return thunk; SMT enabled with STIBP protection",state="mitigation"} 1 +node_cpu_vulnerabilities_info{codename="spectre_v1",mitigation="usercopy/swapgs barriers and __user pointer sanitization",state="mitigation"} 1 +node_cpu_vulnerabilities_info{codename="spectre_v2",mitigation="Retpolines, IBPB: conditional, STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected",state="mitigation"} 1 # HELP node_disk_ata_rotation_rate_rpm ATA disk rotation rate in RPMs (0 for SSDs). # TYPE node_disk_ata_rotation_rate_rpm gauge node_disk_ata_rotation_rate_rpm{device="sda"} 7200 @@ -723,50 +740,66 @@ node_entropy_available_bits 1337 # HELP node_entropy_pool_size_bits Bits of entropy pool. # TYPE node_entropy_pool_size_bits gauge node_entropy_pool_size_bits 4096 -# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which node_exporter was built. +# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which node_exporter was built, and the goos and goarch for the build. # TYPE node_exporter_build_info gauge +# HELP node_fibrechannel_dumped_frames_total Number of dumped frames +# TYPE node_fibrechannel_dumped_frames_total counter +node_fibrechannel_dumped_frames_total{fc_host="host1"} 0 # HELP node_fibrechannel_error_frames_total Number of errors in frames # TYPE node_fibrechannel_error_frames_total counter node_fibrechannel_error_frames_total{fc_host="host0"} 0 +node_fibrechannel_error_frames_total{fc_host="host1"} 19 # HELP node_fibrechannel_fcp_packet_aborts_total Number of aborted packets # TYPE node_fibrechannel_fcp_packet_aborts_total counter node_fibrechannel_fcp_packet_aborts_total{fc_host="host0"} 19 # HELP node_fibrechannel_info Non-numeric data from /sys/class/fc_host/, value is always 1. # TYPE node_fibrechannel_info gauge +node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1 node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1 # HELP node_fibrechannel_invalid_crc_total Invalid Cyclic Redundancy Check count # TYPE node_fibrechannel_invalid_crc_total counter node_fibrechannel_invalid_crc_total{fc_host="host0"} 2 +node_fibrechannel_invalid_crc_total{fc_host="host1"} 32 # HELP node_fibrechannel_invalid_tx_words_total Number of invalid words transmitted by host port # TYPE node_fibrechannel_invalid_tx_words_total counter node_fibrechannel_invalid_tx_words_total{fc_host="host0"} 8 +node_fibrechannel_invalid_tx_words_total{fc_host="host1"} 128 # HELP node_fibrechannel_link_failure_total Number of times the host port link has failed # TYPE node_fibrechannel_link_failure_total counter node_fibrechannel_link_failure_total{fc_host="host0"} 9 +node_fibrechannel_link_failure_total{fc_host="host1"} 144 # HELP node_fibrechannel_loss_of_signal_total Number of times signal has been lost # TYPE node_fibrechannel_loss_of_signal_total counter node_fibrechannel_loss_of_signal_total{fc_host="host0"} 17 +node_fibrechannel_loss_of_signal_total{fc_host="host1"} 272 # HELP node_fibrechannel_loss_of_sync_total Number of failures on either bit or transmission word boundaries # TYPE node_fibrechannel_loss_of_sync_total counter node_fibrechannel_loss_of_sync_total{fc_host="host0"} 16 +node_fibrechannel_loss_of_sync_total{fc_host="host1"} 256 # HELP node_fibrechannel_nos_total Number Not_Operational Primitive Sequence received by host port # TYPE node_fibrechannel_nos_total counter node_fibrechannel_nos_total{fc_host="host0"} 18 +node_fibrechannel_nos_total{fc_host="host1"} 288 # HELP node_fibrechannel_rx_frames_total Number of frames received # TYPE node_fibrechannel_rx_frames_total counter node_fibrechannel_rx_frames_total{fc_host="host0"} 3 +node_fibrechannel_rx_frames_total{fc_host="host1"} 48 # HELP node_fibrechannel_rx_words_total Number of words received by host port # TYPE node_fibrechannel_rx_words_total counter node_fibrechannel_rx_words_total{fc_host="host0"} 4 +node_fibrechannel_rx_words_total{fc_host="host1"} 64 # HELP node_fibrechannel_seconds_since_last_reset_total Number of seconds since last host port reset # TYPE node_fibrechannel_seconds_since_last_reset_total counter node_fibrechannel_seconds_since_last_reset_total{fc_host="host0"} 7 +node_fibrechannel_seconds_since_last_reset_total{fc_host="host1"} 112 # HELP node_fibrechannel_tx_frames_total Number of frames transmitted by host port # TYPE node_fibrechannel_tx_frames_total counter node_fibrechannel_tx_frames_total{fc_host="host0"} 5 +node_fibrechannel_tx_frames_total{fc_host="host1"} 80 # HELP node_fibrechannel_tx_words_total Number of words transmitted by host port # TYPE node_fibrechannel_tx_words_total counter node_fibrechannel_tx_words_total{fc_host="host0"} 6 +node_fibrechannel_tx_words_total{fc_host="host1"} 96 # HELP node_filefd_allocated File descriptor statistics: allocated. # TYPE node_filefd_allocated gauge node_filefd_allocated 1024 @@ -931,18 +964,18 @@ node_hwmon_pwm_weight_temp_step_tol{chip="nct6779",sensor="pwm1"} 0 # TYPE node_hwmon_sensor_label gauge node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp1"} 1 node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_applesmc_768",label="left_side",sensor="fan1"} 1 -node_hwmon_sensor_label{chip="platform_applesmc_768",label="right_side",sensor="fan2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_0",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_1",sensor="temp3"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_2",sensor="temp4"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_3",sensor="temp5"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="physical_id_0",sensor="temp1"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_0",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_1",sensor="temp3"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_2",sensor="temp4"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_3",sensor="temp5"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="physical_id_0",sensor="temp1"} 1 +node_hwmon_sensor_label{chip="platform_applesmc_768",label="Left side ",sensor="fan1"} 1 +node_hwmon_sensor_label{chip="platform_applesmc_768",label="Right side ",sensor="fan2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 0",sensor="temp2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 1",sensor="temp3"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 2",sensor="temp4"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 3",sensor="temp5"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Physical id 0",sensor="temp1"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 0",sensor="temp2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 1",sensor="temp3"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 2",sensor="temp4"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 3",sensor="temp5"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Physical id 0",sensor="temp1"} 1 # HELP node_hwmon_temp_celsius Hardware monitor for temperature (input) # TYPE node_hwmon_temp_celsius gauge node_hwmon_temp_celsius{chip="hwmon4",sensor="temp1"} 55 @@ -2286,6 +2319,9 @@ node_netstat_TcpExt_SyncookiesRecv 0 # HELP node_netstat_TcpExt_SyncookiesSent Statistic TcpExtSyncookiesSent. # TYPE node_netstat_TcpExt_SyncookiesSent untyped node_netstat_TcpExt_SyncookiesSent 0 +# HELP node_netstat_TcpExt_TCPOFOQueue Statistic TcpExtTCPOFOQueue. +# TYPE node_netstat_TcpExt_TCPOFOQueue untyped +node_netstat_TcpExt_TCPOFOQueue 42 # HELP node_netstat_TcpExt_TCPTimeouts Statistic TcpExtTCPTimeouts. # TYPE node_netstat_TcpExt_TCPTimeouts untyped node_netstat_TcpExt_TCPTimeouts 115 @@ -2355,67 +2391,67 @@ node_netstat_Udp_RcvbufErrors 9 # HELP node_netstat_Udp_SndbufErrors Statistic UdpSndbufErrors. # TYPE node_netstat_Udp_SndbufErrors untyped node_netstat_Udp_SndbufErrors 8 -# HELP node_network_address_assign_type address_assign_type value of /sys/class/net/. +# HELP node_network_address_assign_type Network device property: address_assign_type # TYPE node_network_address_assign_type gauge node_network_address_assign_type{device="bond0"} 3 node_network_address_assign_type{device="eth0"} 3 -# HELP node_network_carrier carrier value of /sys/class/net/. +# HELP node_network_carrier Network device property: carrier # TYPE node_network_carrier gauge node_network_carrier{device="bond0"} 1 node_network_carrier{device="eth0"} 1 -# HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/. +# HELP node_network_carrier_changes_total Network device property: carrier_changes_total # TYPE node_network_carrier_changes_total counter node_network_carrier_changes_total{device="bond0"} 2 node_network_carrier_changes_total{device="eth0"} 2 -# HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/. +# HELP node_network_carrier_down_changes_total Network device property: carrier_down_changes_total # TYPE node_network_carrier_down_changes_total counter node_network_carrier_down_changes_total{device="bond0"} 1 node_network_carrier_down_changes_total{device="eth0"} 1 -# HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/. +# HELP node_network_carrier_up_changes_total Network device property: carrier_up_changes_total # TYPE node_network_carrier_up_changes_total counter node_network_carrier_up_changes_total{device="bond0"} 1 node_network_carrier_up_changes_total{device="eth0"} 1 -# HELP node_network_device_id device_id value of /sys/class/net/. +# HELP node_network_device_id Network device property: device_id # TYPE node_network_device_id gauge node_network_device_id{device="bond0"} 32 node_network_device_id{device="eth0"} 32 -# HELP node_network_dormant dormant value of /sys/class/net/. +# HELP node_network_dormant Network device property: dormant # TYPE node_network_dormant gauge node_network_dormant{device="bond0"} 1 node_network_dormant{device="eth0"} 1 -# HELP node_network_flags flags value of /sys/class/net/. +# HELP node_network_flags Network device property: flags # TYPE node_network_flags gauge node_network_flags{device="bond0"} 4867 node_network_flags{device="eth0"} 4867 -# HELP node_network_iface_id iface_id value of /sys/class/net/. +# HELP node_network_iface_id Network device property: iface_id # TYPE node_network_iface_id gauge node_network_iface_id{device="bond0"} 2 node_network_iface_id{device="eth0"} 2 -# HELP node_network_iface_link iface_link value of /sys/class/net/. +# HELP node_network_iface_link Network device property: iface_link # TYPE node_network_iface_link gauge node_network_iface_link{device="bond0"} 2 node_network_iface_link{device="eth0"} 2 -# HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/. +# HELP node_network_iface_link_mode Network device property: iface_link_mode # TYPE node_network_iface_link_mode gauge node_network_iface_link_mode{device="bond0"} 1 node_network_iface_link_mode{device="eth0"} 1 # HELP node_network_info Non-numeric data from /sys/class/net/, value is always 1. # TYPE node_network_info gauge -node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="bond0",duplex="full",ifalias="",operstate="up"} 1 -node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 -# HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/. +node_network_info{address="01:01:01:01:01:01",adminstate="up",broadcast="ff:ff:ff:ff:ff:ff",device="bond0",duplex="full",ifalias="",operstate="up"} 1 +node_network_info{address="01:01:01:01:01:01",adminstate="up",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 +# HELP node_network_mtu_bytes Network device property: mtu_bytes # TYPE node_network_mtu_bytes gauge node_network_mtu_bytes{device="bond0"} 1500 node_network_mtu_bytes{device="eth0"} 1500 -# HELP node_network_name_assign_type name_assign_type value of /sys/class/net/. +# HELP node_network_name_assign_type Network device property: name_assign_type # TYPE node_network_name_assign_type gauge node_network_name_assign_type{device="bond0"} 2 node_network_name_assign_type{device="eth0"} 2 -# HELP node_network_net_dev_group net_dev_group value of /sys/class/net/. +# HELP node_network_net_dev_group Network device property: net_dev_group # TYPE node_network_net_dev_group gauge node_network_net_dev_group{device="bond0"} 0 node_network_net_dev_group{device="eth0"} 0 -# HELP node_network_protocol_type protocol_type value of /sys/class/net/. +# HELP node_network_protocol_type Network device property: protocol_type # TYPE node_network_protocol_type gauge node_network_protocol_type{device="bond0"} 1 node_network_protocol_type{device="eth0"} 1 @@ -2444,7 +2480,7 @@ node_network_receive_multicast_total{device="lo"} 0 node_network_receive_nohandler_total{device="lo"} 0 # HELP node_network_receive_packets_total Network device statistic receive_packets. # TYPE node_network_receive_packets_total counter -# HELP node_network_speed_bytes speed_bytes value of /sys/class/net/. +# HELP node_network_speed_bytes Network device property: speed_bytes # TYPE node_network_speed_bytes gauge node_network_speed_bytes{device="eth0"} 1.25e+08 # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. @@ -2469,7 +2505,7 @@ node_network_transmit_errs_total{device="lo"} 0 node_network_transmit_fifo_total{device="lo"} 0 # HELP node_network_transmit_packets_total Network device statistic transmit_packets. # TYPE node_network_transmit_packets_total counter -# HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/. +# HELP node_network_transmit_queue_length Network device property: transmit_queue_length # TYPE node_network_transmit_queue_length gauge node_network_transmit_queue_length{device="bond0"} 1000 node_network_transmit_queue_length{device="eth0"} 1000 @@ -2721,13 +2757,16 @@ node_nfsd_requests_total{method="SecInfo",proto="4"} 0 node_nfsd_requests_total{method="SetAttr",proto="2"} 0 node_nfsd_requests_total{method="SetAttr",proto="3"} 0 node_nfsd_requests_total{method="SetAttr",proto="4"} 0 +node_nfsd_requests_total{method="SetClientID",proto="4"} 3 +node_nfsd_requests_total{method="SetClientIDConfirm",proto="4"} 3 node_nfsd_requests_total{method="SymLink",proto="2"} 0 node_nfsd_requests_total{method="SymLink",proto="3"} 0 -node_nfsd_requests_total{method="Verify",proto="4"} 3 +node_nfsd_requests_total{method="Verify",proto="4"} 0 +node_nfsd_requests_total{method="WdelegGetattr",proto="4"} 15 node_nfsd_requests_total{method="WrCache",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="3"} 0 -node_nfsd_requests_total{method="Write",proto="4"} 3 +node_nfsd_requests_total{method="Write",proto="4"} 0 # HELP node_nfsd_rpc_errors_total Total number of NFSd RPC errors by error type. # TYPE node_nfsd_rpc_errors_total counter node_nfsd_rpc_errors_total{error="auth"} 2 @@ -2766,7 +2805,7 @@ node_power_supply_energy_watthour{power_supply="BAT0"} 36.58 # HELP node_power_supply_info info of /sys/class/power_supply/. # TYPE node_power_supply_info gauge node_power_supply_info{power_supply="AC",type="Mains"} 1 -node_power_supply_info{capacity_level="Normal",manufacturer="LGC",model_name="LNV-45N1�",power_supply="BAT0",serial_number="38109",status="Discharging",technology="Li-ion",type="Battery"} 1 +node_power_supply_info{capacity_level="Normal",manufacturer="LGC",model_name="LNV-45N1��",power_supply="BAT0",serial_number="38109",status="Discharging",technology="Li-ion",type="Battery"} 1 # HELP node_power_supply_online online value of /sys/class/power_supply/. # TYPE node_power_supply_online gauge node_power_supply_online{power_supply="AC"} 0 @@ -2877,6 +2916,7 @@ node_scrape_collector_success{collector="buddyinfo"} 1 node_scrape_collector_success{collector="cgroups"} 1 node_scrape_collector_success{collector="conntrack"} 1 node_scrape_collector_success{collector="cpu"} 1 +node_scrape_collector_success{collector="cpu_vulnerabilities"} 1 node_scrape_collector_success{collector="cpufreq"} 1 node_scrape_collector_success{collector="diskstats"} 1 node_scrape_collector_success{collector="dmi"} 1 @@ -2909,9 +2949,9 @@ node_scrape_collector_success{collector="processes"} 1 node_scrape_collector_success{collector="qdisc"} 1 node_scrape_collector_success{collector="rapl"} 1 node_scrape_collector_success{collector="schedstat"} 1 -node_scrape_collector_success{collector="selinux"} 1 node_scrape_collector_success{collector="slabinfo"} 1 node_scrape_collector_success{collector="sockstat"} 1 +node_scrape_collector_success{collector="softirqs"} 1 node_scrape_collector_success{collector="softnet"} 1 node_scrape_collector_success{collector="stat"} 1 node_scrape_collector_success{collector="sysctl"} 1 @@ -2921,13 +2961,12 @@ node_scrape_collector_success{collector="thermal_zone"} 1 node_scrape_collector_success{collector="time"} 1 node_scrape_collector_success{collector="udp_queues"} 1 node_scrape_collector_success{collector="vmstat"} 1 +node_scrape_collector_success{collector="watchdog"} 1 node_scrape_collector_success{collector="wifi"} 1 +node_scrape_collector_success{collector="xfrm"} 1 node_scrape_collector_success{collector="xfs"} 1 node_scrape_collector_success{collector="zfs"} 1 node_scrape_collector_success{collector="zoneinfo"} 1 -# HELP node_selinux_enabled SELinux is enabled, 1 is true, 0 is false -# TYPE node_selinux_enabled gauge -node_selinux_enabled 0 # HELP node_slabinfo_active_objects The number of objects that are currently active (i.e., in use). # TYPE node_slabinfo_active_objects gauge node_slabinfo_active_objects{slab="dmaengine-unmap-128"} 1206 @@ -3018,6 +3057,28 @@ node_sockstat_UDP_mem_bytes 0 # HELP node_sockstat_sockets_used Number of IPv4 sockets in use. # TYPE node_sockstat_sockets_used gauge node_sockstat_sockets_used 229 +# HELP node_softirqs_functions_total Softirq counts per CPU. +# TYPE node_softirqs_functions_total counter +node_softirqs_functions_total{cpu="0",type="BLOCK"} 23776 +node_softirqs_functions_total{cpu="0",type="HI"} 7 +node_softirqs_functions_total{cpu="0",type="HRTIMER"} 40 +node_softirqs_functions_total{cpu="0",type="IRQ_POLL"} 0 +node_softirqs_functions_total{cpu="0",type="NET_RX"} 43066 +node_softirqs_functions_total{cpu="0",type="NET_TX"} 2301 +node_softirqs_functions_total{cpu="0",type="RCU"} 155929 +node_softirqs_functions_total{cpu="0",type="SCHED"} 378895 +node_softirqs_functions_total{cpu="0",type="TASKLET"} 372 +node_softirqs_functions_total{cpu="0",type="TIMER"} 424191 +node_softirqs_functions_total{cpu="1",type="BLOCK"} 24115 +node_softirqs_functions_total{cpu="1",type="HI"} 1 +node_softirqs_functions_total{cpu="1",type="HRTIMER"} 346 +node_softirqs_functions_total{cpu="1",type="IRQ_POLL"} 0 +node_softirqs_functions_total{cpu="1",type="NET_RX"} 104508 +node_softirqs_functions_total{cpu="1",type="NET_TX"} 2430 +node_softirqs_functions_total{cpu="1",type="RCU"} 146631 +node_softirqs_functions_total{cpu="1",type="SCHED"} 152852 +node_softirqs_functions_total{cpu="1",type="TASKLET"} 1899 +node_softirqs_functions_total{cpu="1",type="TIMER"} 108342 # HELP node_softirqs_total Number of softirq calls. # TYPE node_softirqs_total counter node_softirqs_total{vector="block"} 186066 @@ -3030,18 +3091,42 @@ node_softirqs_total{vector="rcu"} 508444 node_softirqs_total{vector="sched"} 622196 node_softirqs_total{vector="tasklet"} 1.783454e+06 node_softirqs_total{vector="timer"} 1.481983e+06 +# HELP node_softnet_backlog_len Softnet backlog status +# TYPE node_softnet_backlog_len gauge +node_softnet_backlog_len{cpu="0"} 0 +node_softnet_backlog_len{cpu="1"} 0 +node_softnet_backlog_len{cpu="2"} 0 +node_softnet_backlog_len{cpu="3"} 0 +# HELP node_softnet_cpu_collision_total Number of collision occur while obtaining device lock while transmitting +# TYPE node_softnet_cpu_collision_total counter +node_softnet_cpu_collision_total{cpu="0"} 0 +node_softnet_cpu_collision_total{cpu="1"} 0 +node_softnet_cpu_collision_total{cpu="2"} 0 +node_softnet_cpu_collision_total{cpu="3"} 0 # HELP node_softnet_dropped_total Number of dropped packets # TYPE node_softnet_dropped_total counter node_softnet_dropped_total{cpu="0"} 0 node_softnet_dropped_total{cpu="1"} 41 node_softnet_dropped_total{cpu="2"} 0 node_softnet_dropped_total{cpu="3"} 0 +# HELP node_softnet_flow_limit_count_total Number of times flow limit has been reached +# TYPE node_softnet_flow_limit_count_total counter +node_softnet_flow_limit_count_total{cpu="0"} 0 +node_softnet_flow_limit_count_total{cpu="1"} 0 +node_softnet_flow_limit_count_total{cpu="2"} 0 +node_softnet_flow_limit_count_total{cpu="3"} 0 # HELP node_softnet_processed_total Number of processed packets # TYPE node_softnet_processed_total counter node_softnet_processed_total{cpu="0"} 299641 node_softnet_processed_total{cpu="1"} 916354 node_softnet_processed_total{cpu="2"} 5.577791e+06 node_softnet_processed_total{cpu="3"} 3.113785e+06 +# HELP node_softnet_received_rps_total Number of times cpu woken up received_rps +# TYPE node_softnet_received_rps_total counter +node_softnet_received_rps_total{cpu="0"} 0 +node_softnet_received_rps_total{cpu="1"} 0 +node_softnet_received_rps_total{cpu="2"} 0 +node_softnet_received_rps_total{cpu="3"} 0 # HELP node_softnet_times_squeezed_total Number of times processing packets ran out of quota # TYPE node_softnet_times_squeezed_total counter node_softnet_times_squeezed_total{cpu="0"} 1 @@ -3150,6 +3235,31 @@ node_vmstat_pswpin 1476 # HELP node_vmstat_pswpout /proc/vmstat information field pswpout. # TYPE node_vmstat_pswpout untyped node_vmstat_pswpout 35045 +# HELP node_watchdog_access_cs0 Value of /sys/class/watchdog//access_cs0 +# TYPE node_watchdog_access_cs0 gauge +node_watchdog_access_cs0{name="watchdog0"} 0 +# HELP node_watchdog_bootstatus Value of /sys/class/watchdog//bootstatus +# TYPE node_watchdog_bootstatus gauge +node_watchdog_bootstatus{name="watchdog0"} 1 +# HELP node_watchdog_fw_version Value of /sys/class/watchdog//fw_version +# TYPE node_watchdog_fw_version gauge +node_watchdog_fw_version{name="watchdog0"} 2 +# HELP node_watchdog_info Info of /sys/class/watchdog/ +# TYPE node_watchdog_info gauge +node_watchdog_info{identity="",name="watchdog1",options="",pretimeout_governor="",state="",status=""} 1 +node_watchdog_info{identity="Software Watchdog",name="watchdog0",options="0x8380",pretimeout_governor="noop",state="active",status="0x8000"} 1 +# HELP node_watchdog_nowayout Value of /sys/class/watchdog//nowayout +# TYPE node_watchdog_nowayout gauge +node_watchdog_nowayout{name="watchdog0"} 0 +# HELP node_watchdog_pretimeout_seconds Value of /sys/class/watchdog//pretimeout +# TYPE node_watchdog_pretimeout_seconds gauge +node_watchdog_pretimeout_seconds{name="watchdog0"} 120 +# HELP node_watchdog_timeleft_seconds Value of /sys/class/watchdog//timeleft +# TYPE node_watchdog_timeleft_seconds gauge +node_watchdog_timeleft_seconds{name="watchdog0"} 300 +# HELP node_watchdog_timeout_seconds Value of /sys/class/watchdog//timeout +# TYPE node_watchdog_timeout_seconds gauge +node_watchdog_timeout_seconds{name="watchdog0"} 60 # HELP node_wifi_interface_frequency_hertz The current frequency a WiFi interface is operating at, in hertz. # TYPE node_wifi_interface_frequency_hertz gauge node_wifi_interface_frequency_hertz{device="wlan0"} 2.412e+09 @@ -3197,6 +3307,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd: # TYPE node_wifi_station_transmit_retries_total counter node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20 node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10 +# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use +# TYPE node_xfrm_acquire_error_packets_total counter +node_xfrm_acquire_error_packets_total 24532 +# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed +# TYPE node_xfrm_fwd_hdr_error_packets_total counter +node_xfrm_fwd_hdr_error_packets_total 6654 +# HELP node_xfrm_in_buffer_error_packets_total No buffer is left +# TYPE node_xfrm_in_buffer_error_packets_total counter +node_xfrm_in_buffer_error_packets_total 2 +# HELP node_xfrm_in_error_packets_total All errors not matched by other +# TYPE node_xfrm_in_error_packets_total counter +node_xfrm_in_error_packets_total 1 +# HELP node_xfrm_in_hdr_error_packets_total Header error +# TYPE node_xfrm_in_hdr_error_packets_total counter +node_xfrm_in_hdr_error_packets_total 4 +# HELP node_xfrm_in_no_pols_packets_total No policy is found for states e.g. Inbound SAs are correct but no SP is found +# TYPE node_xfrm_in_no_pols_packets_total counter +node_xfrm_in_no_pols_packets_total 65432 +# HELP node_xfrm_in_no_states_packets_total No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong +# TYPE node_xfrm_in_no_states_packets_total counter +node_xfrm_in_no_states_packets_total 3 +# HELP node_xfrm_in_pol_block_packets_total Policy discards +# TYPE node_xfrm_in_pol_block_packets_total counter +node_xfrm_in_pol_block_packets_total 100 +# HELP node_xfrm_in_pol_error_packets_total Policy error +# TYPE node_xfrm_in_pol_error_packets_total counter +node_xfrm_in_pol_error_packets_total 10000 +# HELP node_xfrm_in_state_expired_packets_total State is expired +# TYPE node_xfrm_in_state_expired_packets_total counter +node_xfrm_in_state_expired_packets_total 7 +# HELP node_xfrm_in_state_invalid_packets_total State is invalid +# TYPE node_xfrm_in_state_invalid_packets_total counter +node_xfrm_in_state_invalid_packets_total 55555 +# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch +# TYPE node_xfrm_in_state_mismatch_packets_total counter +node_xfrm_in_state_mismatch_packets_total 23451 +# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error +# TYPE node_xfrm_in_state_mode_error_packets_total counter +node_xfrm_in_state_mode_error_packets_total 100 +# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong +# TYPE node_xfrm_in_state_proto_error_packets_total counter +node_xfrm_in_state_proto_error_packets_total 40 +# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window +# TYPE node_xfrm_in_state_seq_error_packets_total counter +node_xfrm_in_state_seq_error_packets_total 6000 +# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong +# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter +node_xfrm_in_tmpl_mismatch_packets_total 51 +# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error +# TYPE node_xfrm_out_bundle_check_error_packets_total counter +node_xfrm_out_bundle_check_error_packets_total 555 +# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error +# TYPE node_xfrm_out_bundle_gen_error_packets_total counter +node_xfrm_out_bundle_gen_error_packets_total 43321 +# HELP node_xfrm_out_error_packets_total All errors which is not matched others +# TYPE node_xfrm_out_error_packets_total counter +node_xfrm_out_error_packets_total 1e+06 +# HELP node_xfrm_out_no_states_packets_total No state is found +# TYPE node_xfrm_out_no_states_packets_total counter +node_xfrm_out_no_states_packets_total 869 +# HELP node_xfrm_out_pol_block_packets_total Policy discards +# TYPE node_xfrm_out_pol_block_packets_total counter +node_xfrm_out_pol_block_packets_total 43456 +# HELP node_xfrm_out_pol_dead_packets_total Policy is dead +# TYPE node_xfrm_out_pol_dead_packets_total counter +node_xfrm_out_pol_dead_packets_total 7656 +# HELP node_xfrm_out_pol_error_packets_total Policy error +# TYPE node_xfrm_out_pol_error_packets_total counter +node_xfrm_out_pol_error_packets_total 1454 +# HELP node_xfrm_out_state_expired_packets_total State is expired +# TYPE node_xfrm_out_state_expired_packets_total counter +node_xfrm_out_state_expired_packets_total 565 +# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired +# TYPE node_xfrm_out_state_invalid_packets_total counter +node_xfrm_out_state_invalid_packets_total 28765 +# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error +# TYPE node_xfrm_out_state_mode_error_packets_total counter +node_xfrm_out_state_mode_error_packets_total 8 +# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error +# TYPE node_xfrm_out_state_proto_error_packets_total counter +node_xfrm_out_state_proto_error_packets_total 4542 +# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow +# TYPE node_xfrm_out_state_seq_error_packets_total counter +node_xfrm_out_state_seq_error_packets_total 543 # HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem. # TYPE node_xfs_allocation_btree_compares_total counter node_xfs_allocation_btree_compares_total{device="sda1"} 0 @@ -3650,193 +3844,193 @@ node_zfs_arc_prefetch_metadata_misses 16071 # HELP node_zfs_arc_size kstat.zfs.misc.arcstats.size # TYPE node_zfs_arc_size untyped node_zfs_arc_size 1.603939792e+09 -# HELP node_zfs_dbuf_dbuf_cache_count kstat.zfs.misc.dbuf_stats.dbuf_cache_count +# HELP node_zfs_dbuf_dbuf_cache_count kstat.zfs.misc.dbufstats.dbuf_cache_count # TYPE node_zfs_dbuf_dbuf_cache_count untyped node_zfs_dbuf_dbuf_cache_count 27 -# HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_hiwater_bytes +# HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbufstats.dbuf_cache_hiwater_bytes # TYPE node_zfs_dbuf_dbuf_cache_hiwater_bytes untyped node_zfs_dbuf_dbuf_cache_hiwater_bytes 6.9117804e+07 -# HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0 +# HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbufstats.dbuf_cache_level_0 # TYPE node_zfs_dbuf_dbuf_cache_level_0 untyped node_zfs_dbuf_dbuf_cache_level_0 27 -# HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_0_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_0_bytes untyped node_zfs_dbuf_dbuf_cache_level_0_bytes 302080 -# HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1 +# HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbufstats.dbuf_cache_level_1 # TYPE node_zfs_dbuf_dbuf_cache_level_1 untyped node_zfs_dbuf_dbuf_cache_level_1 0 -# HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10 +# HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbufstats.dbuf_cache_level_10 # TYPE node_zfs_dbuf_dbuf_cache_level_10 untyped node_zfs_dbuf_dbuf_cache_level_10 0 -# HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_10_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_10_bytes untyped node_zfs_dbuf_dbuf_cache_level_10_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11 +# HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbufstats.dbuf_cache_level_11 # TYPE node_zfs_dbuf_dbuf_cache_level_11 untyped node_zfs_dbuf_dbuf_cache_level_11 0 -# HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_11_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_11_bytes untyped node_zfs_dbuf_dbuf_cache_level_11_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_1_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_1_bytes untyped node_zfs_dbuf_dbuf_cache_level_1_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2 +# HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbufstats.dbuf_cache_level_2 # TYPE node_zfs_dbuf_dbuf_cache_level_2 untyped node_zfs_dbuf_dbuf_cache_level_2 0 -# HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_2_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_2_bytes untyped node_zfs_dbuf_dbuf_cache_level_2_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3 +# HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbufstats.dbuf_cache_level_3 # TYPE node_zfs_dbuf_dbuf_cache_level_3 untyped node_zfs_dbuf_dbuf_cache_level_3 0 -# HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_3_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_3_bytes untyped node_zfs_dbuf_dbuf_cache_level_3_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4 +# HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbufstats.dbuf_cache_level_4 # TYPE node_zfs_dbuf_dbuf_cache_level_4 untyped node_zfs_dbuf_dbuf_cache_level_4 0 -# HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_4_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_4_bytes untyped node_zfs_dbuf_dbuf_cache_level_4_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5 +# HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbufstats.dbuf_cache_level_5 # TYPE node_zfs_dbuf_dbuf_cache_level_5 untyped node_zfs_dbuf_dbuf_cache_level_5 0 -# HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_5_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_5_bytes untyped node_zfs_dbuf_dbuf_cache_level_5_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6 +# HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbufstats.dbuf_cache_level_6 # TYPE node_zfs_dbuf_dbuf_cache_level_6 untyped node_zfs_dbuf_dbuf_cache_level_6 0 -# HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_6_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_6_bytes untyped node_zfs_dbuf_dbuf_cache_level_6_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7 +# HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbufstats.dbuf_cache_level_7 # TYPE node_zfs_dbuf_dbuf_cache_level_7 untyped node_zfs_dbuf_dbuf_cache_level_7 0 -# HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_7_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_7_bytes untyped node_zfs_dbuf_dbuf_cache_level_7_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8 +# HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbufstats.dbuf_cache_level_8 # TYPE node_zfs_dbuf_dbuf_cache_level_8 untyped node_zfs_dbuf_dbuf_cache_level_8 0 -# HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_8_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_8_bytes untyped node_zfs_dbuf_dbuf_cache_level_8_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9 +# HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbufstats.dbuf_cache_level_9 # TYPE node_zfs_dbuf_dbuf_cache_level_9 untyped node_zfs_dbuf_dbuf_cache_level_9 0 -# HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_9_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_9_bytes untyped node_zfs_dbuf_dbuf_cache_level_9_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_lowater_bytes +# HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbufstats.dbuf_cache_lowater_bytes # TYPE node_zfs_dbuf_dbuf_cache_lowater_bytes untyped node_zfs_dbuf_dbuf_cache_lowater_bytes 5.6550932e+07 -# HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_max_bytes +# HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbufstats.dbuf_cache_max_bytes # TYPE node_zfs_dbuf_dbuf_cache_max_bytes untyped node_zfs_dbuf_dbuf_cache_max_bytes 6.2834368e+07 -# HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbuf_stats.dbuf_cache_size +# HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbufstats.dbuf_cache_size # TYPE node_zfs_dbuf_dbuf_cache_size untyped node_zfs_dbuf_dbuf_cache_size 302080 -# HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbuf_stats.dbuf_cache_size_max +# HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbufstats.dbuf_cache_size_max # TYPE node_zfs_dbuf_dbuf_cache_size_max untyped node_zfs_dbuf_dbuf_cache_size_max 394240 -# HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbuf_stats.dbuf_cache_total_evicts +# HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbufstats.dbuf_cache_total_evicts # TYPE node_zfs_dbuf_dbuf_cache_total_evicts untyped node_zfs_dbuf_dbuf_cache_total_evicts 0 -# HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbuf_stats.hash_chain_max +# HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbufstats.hash_chain_max # TYPE node_zfs_dbuf_hash_chain_max untyped node_zfs_dbuf_hash_chain_max 0 -# HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbuf_stats.hash_chains +# HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbufstats.hash_chains # TYPE node_zfs_dbuf_hash_chains untyped node_zfs_dbuf_hash_chains 0 -# HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbuf_stats.hash_collisions +# HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbufstats.hash_collisions # TYPE node_zfs_dbuf_hash_collisions untyped node_zfs_dbuf_hash_collisions 0 -# HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0 +# HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbufstats.hash_dbuf_level_0 # TYPE node_zfs_dbuf_hash_dbuf_level_0 untyped node_zfs_dbuf_hash_dbuf_level_0 37 -# HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_0_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_0_bytes untyped node_zfs_dbuf_hash_dbuf_level_0_bytes 465920 -# HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1 +# HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbufstats.hash_dbuf_level_1 # TYPE node_zfs_dbuf_hash_dbuf_level_1 untyped node_zfs_dbuf_hash_dbuf_level_1 10 -# HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10 +# HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbufstats.hash_dbuf_level_10 # TYPE node_zfs_dbuf_hash_dbuf_level_10 untyped node_zfs_dbuf_hash_dbuf_level_10 0 -# HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_10_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_10_bytes untyped node_zfs_dbuf_hash_dbuf_level_10_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11 +# HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbufstats.hash_dbuf_level_11 # TYPE node_zfs_dbuf_hash_dbuf_level_11 untyped node_zfs_dbuf_hash_dbuf_level_11 0 -# HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_11_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_11_bytes untyped node_zfs_dbuf_hash_dbuf_level_11_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_1_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_1_bytes untyped node_zfs_dbuf_hash_dbuf_level_1_bytes 1.31072e+06 -# HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2 +# HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbufstats.hash_dbuf_level_2 # TYPE node_zfs_dbuf_hash_dbuf_level_2 untyped node_zfs_dbuf_hash_dbuf_level_2 2 -# HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_2_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_2_bytes untyped node_zfs_dbuf_hash_dbuf_level_2_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3 +# HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbufstats.hash_dbuf_level_3 # TYPE node_zfs_dbuf_hash_dbuf_level_3 untyped node_zfs_dbuf_hash_dbuf_level_3 2 -# HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_3_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_3_bytes untyped node_zfs_dbuf_hash_dbuf_level_3_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4 +# HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbufstats.hash_dbuf_level_4 # TYPE node_zfs_dbuf_hash_dbuf_level_4 untyped node_zfs_dbuf_hash_dbuf_level_4 2 -# HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_4_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_4_bytes untyped node_zfs_dbuf_hash_dbuf_level_4_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5 +# HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbufstats.hash_dbuf_level_5 # TYPE node_zfs_dbuf_hash_dbuf_level_5 untyped node_zfs_dbuf_hash_dbuf_level_5 2 -# HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_5_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_5_bytes untyped node_zfs_dbuf_hash_dbuf_level_5_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6 +# HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbufstats.hash_dbuf_level_6 # TYPE node_zfs_dbuf_hash_dbuf_level_6 untyped node_zfs_dbuf_hash_dbuf_level_6 0 -# HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_6_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_6_bytes untyped node_zfs_dbuf_hash_dbuf_level_6_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7 +# HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbufstats.hash_dbuf_level_7 # TYPE node_zfs_dbuf_hash_dbuf_level_7 untyped node_zfs_dbuf_hash_dbuf_level_7 0 -# HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_7_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_7_bytes untyped node_zfs_dbuf_hash_dbuf_level_7_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8 +# HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbufstats.hash_dbuf_level_8 # TYPE node_zfs_dbuf_hash_dbuf_level_8 untyped node_zfs_dbuf_hash_dbuf_level_8 0 -# HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_8_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_8_bytes untyped node_zfs_dbuf_hash_dbuf_level_8_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9 +# HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbufstats.hash_dbuf_level_9 # TYPE node_zfs_dbuf_hash_dbuf_level_9 untyped node_zfs_dbuf_hash_dbuf_level_9 0 -# HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_9_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_9_bytes untyped node_zfs_dbuf_hash_dbuf_level_9_bytes 0 -# HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbuf_stats.hash_elements +# HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbufstats.hash_elements # TYPE node_zfs_dbuf_hash_elements untyped node_zfs_dbuf_hash_elements 55 -# HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbuf_stats.hash_elements_max +# HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbufstats.hash_elements_max # TYPE node_zfs_dbuf_hash_elements_max untyped node_zfs_dbuf_hash_elements_max 55 -# HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbuf_stats.hash_hits +# HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbufstats.hash_hits # TYPE node_zfs_dbuf_hash_hits untyped node_zfs_dbuf_hash_hits 108807 -# HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbuf_stats.hash_insert_race +# HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbufstats.hash_insert_race # TYPE node_zfs_dbuf_hash_insert_race untyped node_zfs_dbuf_hash_insert_race 0 -# HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbuf_stats.hash_misses +# HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbufstats.hash_misses # TYPE node_zfs_dbuf_hash_misses untyped node_zfs_dbuf_hash_misses 1851 # HELP node_zfs_dmu_tx_dmu_tx_assigned kstat.zfs.misc.dmu_tx.dmu_tx_assigned @@ -4155,16 +4349,25 @@ node_zfs_zpool_rupdate{zpool="poolz1"} 1.10734831944501e+14 # HELP node_zfs_zpool_state kstat.zfs.misc.state # TYPE node_zfs_zpool_state gauge node_zfs_zpool_state{state="degraded",zpool="pool1"} 0 +node_zfs_zpool_state{state="degraded",zpool="pool2"} 0 node_zfs_zpool_state{state="degraded",zpool="poolz1"} 1 node_zfs_zpool_state{state="faulted",zpool="pool1"} 0 +node_zfs_zpool_state{state="faulted",zpool="pool2"} 0 node_zfs_zpool_state{state="faulted",zpool="poolz1"} 0 node_zfs_zpool_state{state="offline",zpool="pool1"} 0 +node_zfs_zpool_state{state="offline",zpool="pool2"} 0 node_zfs_zpool_state{state="offline",zpool="poolz1"} 0 node_zfs_zpool_state{state="online",zpool="pool1"} 1 +node_zfs_zpool_state{state="online",zpool="pool2"} 0 node_zfs_zpool_state{state="online",zpool="poolz1"} 0 node_zfs_zpool_state{state="removed",zpool="pool1"} 0 +node_zfs_zpool_state{state="removed",zpool="pool2"} 0 node_zfs_zpool_state{state="removed",zpool="poolz1"} 0 +node_zfs_zpool_state{state="suspended",zpool="pool1"} 0 +node_zfs_zpool_state{state="suspended",zpool="pool2"} 1 +node_zfs_zpool_state{state="suspended",zpool="poolz1"} 0 node_zfs_zpool_state{state="unavail",zpool="pool1"} 0 +node_zfs_zpool_state{state="unavail",zpool="pool2"} 0 node_zfs_zpool_state{state="unavail",zpool="poolz1"} 0 # HELP node_zfs_zpool_wcnt kstat.zfs.misc.io.wcnt # TYPE node_zfs_zpool_wcnt untyped diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index c4890888c3..d52cb99d04 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt @@ -97,7 +97,7 @@ node_bcache_cache_misses_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-8 node_bcache_cache_read_races_total{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 # HELP node_bcache_cache_readaheads_total Count of times readahead occurred. # TYPE node_bcache_cache_readaheads_total counter -node_bcache_cache_readaheads_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 +node_bcache_cache_readaheads_total{backing_device="bdev0",uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 13 # HELP node_bcache_congested Congestion. # TYPE node_bcache_congested gauge node_bcache_congested{uuid="deaddd54-c735-46d5-868e-f331c5fd7c74"} 0 @@ -348,6 +348,16 @@ node_cpu_scaling_frequency_min_hertz{cpu="0"} 8e+08 node_cpu_scaling_frequency_min_hertz{cpu="1"} 8e+08 node_cpu_scaling_frequency_min_hertz{cpu="2"} 1e+06 node_cpu_scaling_frequency_min_hertz{cpu="3"} 1e+06 +# HELP node_cpu_scaling_governor Current enabled CPU frequency governor. +# TYPE node_cpu_scaling_governor gauge +node_cpu_scaling_governor{cpu="0",governor="performance"} 0 +node_cpu_scaling_governor{cpu="0",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="1",governor="performance"} 0 +node_cpu_scaling_governor{cpu="1",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="2",governor="performance"} 0 +node_cpu_scaling_governor{cpu="2",governor="powersave"} 1 +node_cpu_scaling_governor{cpu="3",governor="performance"} 0 +node_cpu_scaling_governor{cpu="3",governor="powersave"} 1 # HELP node_cpu_seconds_total Seconds the CPUs spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 10870.69 @@ -414,6 +424,13 @@ node_cpu_seconds_total{cpu="7",mode="softirq"} 0.31 node_cpu_seconds_total{cpu="7",mode="steal"} 0 node_cpu_seconds_total{cpu="7",mode="system"} 101.64 node_cpu_seconds_total{cpu="7",mode="user"} 290.98 +# HELP node_cpu_vulnerabilities_info Details of each CPU vulnerability reported by sysfs. The value of the series is an int encoded state of the vulnerability. The same state is stored as a string in the label +# TYPE node_cpu_vulnerabilities_info gauge +node_cpu_vulnerabilities_info{codename="itlb_multihit",mitigation="",state="not affected"} 1 +node_cpu_vulnerabilities_info{codename="mds",mitigation="",state="vulnerable"} 1 +node_cpu_vulnerabilities_info{codename="retbleed",mitigation="untrained return thunk; SMT enabled with STIBP protection",state="mitigation"} 1 +node_cpu_vulnerabilities_info{codename="spectre_v1",mitigation="usercopy/swapgs barriers and __user pointer sanitization",state="mitigation"} 1 +node_cpu_vulnerabilities_info{codename="spectre_v2",mitigation="Retpolines, IBPB: conditional, STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected",state="mitigation"} 1 # HELP node_disk_ata_rotation_rate_rpm ATA disk rotation rate in RPMs (0 for SSDs). # TYPE node_disk_ata_rotation_rate_rpm gauge node_disk_ata_rotation_rate_rpm{device="sda"} 7200 @@ -745,50 +762,66 @@ node_entropy_available_bits 1337 # HELP node_entropy_pool_size_bits Bits of entropy pool. # TYPE node_entropy_pool_size_bits gauge node_entropy_pool_size_bits 4096 -# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which node_exporter was built. +# HELP node_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which node_exporter was built, and the goos and goarch for the build. # TYPE node_exporter_build_info gauge +# HELP node_fibrechannel_dumped_frames_total Number of dumped frames +# TYPE node_fibrechannel_dumped_frames_total counter +node_fibrechannel_dumped_frames_total{fc_host="host1"} 0 # HELP node_fibrechannel_error_frames_total Number of errors in frames # TYPE node_fibrechannel_error_frames_total counter node_fibrechannel_error_frames_total{fc_host="host0"} 0 +node_fibrechannel_error_frames_total{fc_host="host1"} 19 # HELP node_fibrechannel_fcp_packet_aborts_total Number of aborted packets # TYPE node_fibrechannel_fcp_packet_aborts_total counter node_fibrechannel_fcp_packet_aborts_total{fc_host="host0"} 19 # HELP node_fibrechannel_info Non-numeric data from /sys/class/fc_host/, value is always 1. # TYPE node_fibrechannel_info gauge +node_fibrechannel_info{dev_loss_tmo="",fabric_name="",fc_host="host1",port_id="",port_name="",port_state="",port_type="",speed="8 Gbit",supported_classes="",supported_speeds="",symbolic_name=""} 1 node_fibrechannel_info{dev_loss_tmo="30",fabric_name="0",fc_host="host0",port_id="000002",port_name="1000e0071bce95f2",port_state="Online",port_type="Point-To-Point (direct nport connection)",speed="16 Gbit",supported_classes="Class 3",supported_speeds="4 Gbit, 8 Gbit, 16 Gbit",symbolic_name="Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux"} 1 # HELP node_fibrechannel_invalid_crc_total Invalid Cyclic Redundancy Check count # TYPE node_fibrechannel_invalid_crc_total counter node_fibrechannel_invalid_crc_total{fc_host="host0"} 2 +node_fibrechannel_invalid_crc_total{fc_host="host1"} 32 # HELP node_fibrechannel_invalid_tx_words_total Number of invalid words transmitted by host port # TYPE node_fibrechannel_invalid_tx_words_total counter node_fibrechannel_invalid_tx_words_total{fc_host="host0"} 8 +node_fibrechannel_invalid_tx_words_total{fc_host="host1"} 128 # HELP node_fibrechannel_link_failure_total Number of times the host port link has failed # TYPE node_fibrechannel_link_failure_total counter node_fibrechannel_link_failure_total{fc_host="host0"} 9 +node_fibrechannel_link_failure_total{fc_host="host1"} 144 # HELP node_fibrechannel_loss_of_signal_total Number of times signal has been lost # TYPE node_fibrechannel_loss_of_signal_total counter node_fibrechannel_loss_of_signal_total{fc_host="host0"} 17 +node_fibrechannel_loss_of_signal_total{fc_host="host1"} 272 # HELP node_fibrechannel_loss_of_sync_total Number of failures on either bit or transmission word boundaries # TYPE node_fibrechannel_loss_of_sync_total counter node_fibrechannel_loss_of_sync_total{fc_host="host0"} 16 +node_fibrechannel_loss_of_sync_total{fc_host="host1"} 256 # HELP node_fibrechannel_nos_total Number Not_Operational Primitive Sequence received by host port # TYPE node_fibrechannel_nos_total counter node_fibrechannel_nos_total{fc_host="host0"} 18 +node_fibrechannel_nos_total{fc_host="host1"} 288 # HELP node_fibrechannel_rx_frames_total Number of frames received # TYPE node_fibrechannel_rx_frames_total counter node_fibrechannel_rx_frames_total{fc_host="host0"} 3 +node_fibrechannel_rx_frames_total{fc_host="host1"} 48 # HELP node_fibrechannel_rx_words_total Number of words received by host port # TYPE node_fibrechannel_rx_words_total counter node_fibrechannel_rx_words_total{fc_host="host0"} 4 +node_fibrechannel_rx_words_total{fc_host="host1"} 64 # HELP node_fibrechannel_seconds_since_last_reset_total Number of seconds since last host port reset # TYPE node_fibrechannel_seconds_since_last_reset_total counter node_fibrechannel_seconds_since_last_reset_total{fc_host="host0"} 7 +node_fibrechannel_seconds_since_last_reset_total{fc_host="host1"} 112 # HELP node_fibrechannel_tx_frames_total Number of frames transmitted by host port # TYPE node_fibrechannel_tx_frames_total counter node_fibrechannel_tx_frames_total{fc_host="host0"} 5 +node_fibrechannel_tx_frames_total{fc_host="host1"} 80 # HELP node_fibrechannel_tx_words_total Number of words transmitted by host port # TYPE node_fibrechannel_tx_words_total counter node_fibrechannel_tx_words_total{fc_host="host0"} 6 +node_fibrechannel_tx_words_total{fc_host="host1"} 96 # HELP node_filefd_allocated File descriptor statistics: allocated. # TYPE node_filefd_allocated gauge node_filefd_allocated 1024 @@ -953,18 +986,18 @@ node_hwmon_pwm_weight_temp_step_tol{chip="nct6779",sensor="pwm1"} 0 # TYPE node_hwmon_sensor_label gauge node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp1"} 1 node_hwmon_sensor_label{chip="hwmon4",label="foosensor",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_applesmc_768",label="left_side",sensor="fan1"} 1 -node_hwmon_sensor_label{chip="platform_applesmc_768",label="right_side",sensor="fan2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_0",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_1",sensor="temp3"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_2",sensor="temp4"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="core_3",sensor="temp5"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_0",label="physical_id_0",sensor="temp1"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_0",sensor="temp2"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_1",sensor="temp3"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_2",sensor="temp4"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="core_3",sensor="temp5"} 1 -node_hwmon_sensor_label{chip="platform_coretemp_1",label="physical_id_0",sensor="temp1"} 1 +node_hwmon_sensor_label{chip="platform_applesmc_768",label="Left side ",sensor="fan1"} 1 +node_hwmon_sensor_label{chip="platform_applesmc_768",label="Right side ",sensor="fan2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 0",sensor="temp2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 1",sensor="temp3"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 2",sensor="temp4"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Core 3",sensor="temp5"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_0",label="Physical id 0",sensor="temp1"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 0",sensor="temp2"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 1",sensor="temp3"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 2",sensor="temp4"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Core 3",sensor="temp5"} 1 +node_hwmon_sensor_label{chip="platform_coretemp_1",label="Physical id 0",sensor="temp1"} 1 # HELP node_hwmon_temp_celsius Hardware monitor for temperature (input) # TYPE node_hwmon_temp_celsius gauge node_hwmon_temp_celsius{chip="hwmon4",sensor="temp1"} 55 @@ -2308,6 +2341,9 @@ node_netstat_TcpExt_SyncookiesRecv 0 # HELP node_netstat_TcpExt_SyncookiesSent Statistic TcpExtSyncookiesSent. # TYPE node_netstat_TcpExt_SyncookiesSent untyped node_netstat_TcpExt_SyncookiesSent 0 +# HELP node_netstat_TcpExt_TCPOFOQueue Statistic TcpExtTCPOFOQueue. +# TYPE node_netstat_TcpExt_TCPOFOQueue untyped +node_netstat_TcpExt_TCPOFOQueue 42 # HELP node_netstat_TcpExt_TCPTimeouts Statistic TcpExtTCPTimeouts. # TYPE node_netstat_TcpExt_TCPTimeouts untyped node_netstat_TcpExt_TCPTimeouts 115 @@ -2377,67 +2413,67 @@ node_netstat_Udp_RcvbufErrors 9 # HELP node_netstat_Udp_SndbufErrors Statistic UdpSndbufErrors. # TYPE node_netstat_Udp_SndbufErrors untyped node_netstat_Udp_SndbufErrors 8 -# HELP node_network_address_assign_type address_assign_type value of /sys/class/net/. +# HELP node_network_address_assign_type Network device property: address_assign_type # TYPE node_network_address_assign_type gauge node_network_address_assign_type{device="bond0"} 3 node_network_address_assign_type{device="eth0"} 3 -# HELP node_network_carrier carrier value of /sys/class/net/. +# HELP node_network_carrier Network device property: carrier # TYPE node_network_carrier gauge node_network_carrier{device="bond0"} 1 node_network_carrier{device="eth0"} 1 -# HELP node_network_carrier_changes_total carrier_changes_total value of /sys/class/net/. +# HELP node_network_carrier_changes_total Network device property: carrier_changes_total # TYPE node_network_carrier_changes_total counter node_network_carrier_changes_total{device="bond0"} 2 node_network_carrier_changes_total{device="eth0"} 2 -# HELP node_network_carrier_down_changes_total carrier_down_changes_total value of /sys/class/net/. +# HELP node_network_carrier_down_changes_total Network device property: carrier_down_changes_total # TYPE node_network_carrier_down_changes_total counter node_network_carrier_down_changes_total{device="bond0"} 1 node_network_carrier_down_changes_total{device="eth0"} 1 -# HELP node_network_carrier_up_changes_total carrier_up_changes_total value of /sys/class/net/. +# HELP node_network_carrier_up_changes_total Network device property: carrier_up_changes_total # TYPE node_network_carrier_up_changes_total counter node_network_carrier_up_changes_total{device="bond0"} 1 node_network_carrier_up_changes_total{device="eth0"} 1 -# HELP node_network_device_id device_id value of /sys/class/net/. +# HELP node_network_device_id Network device property: device_id # TYPE node_network_device_id gauge node_network_device_id{device="bond0"} 32 node_network_device_id{device="eth0"} 32 -# HELP node_network_dormant dormant value of /sys/class/net/. +# HELP node_network_dormant Network device property: dormant # TYPE node_network_dormant gauge node_network_dormant{device="bond0"} 1 node_network_dormant{device="eth0"} 1 -# HELP node_network_flags flags value of /sys/class/net/. +# HELP node_network_flags Network device property: flags # TYPE node_network_flags gauge node_network_flags{device="bond0"} 4867 node_network_flags{device="eth0"} 4867 -# HELP node_network_iface_id iface_id value of /sys/class/net/. +# HELP node_network_iface_id Network device property: iface_id # TYPE node_network_iface_id gauge node_network_iface_id{device="bond0"} 2 node_network_iface_id{device="eth0"} 2 -# HELP node_network_iface_link iface_link value of /sys/class/net/. +# HELP node_network_iface_link Network device property: iface_link # TYPE node_network_iface_link gauge node_network_iface_link{device="bond0"} 2 node_network_iface_link{device="eth0"} 2 -# HELP node_network_iface_link_mode iface_link_mode value of /sys/class/net/. +# HELP node_network_iface_link_mode Network device property: iface_link_mode # TYPE node_network_iface_link_mode gauge node_network_iface_link_mode{device="bond0"} 1 node_network_iface_link_mode{device="eth0"} 1 # HELP node_network_info Non-numeric data from /sys/class/net/, value is always 1. # TYPE node_network_info gauge -node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="bond0",duplex="full",ifalias="",operstate="up"} 1 -node_network_info{address="01:01:01:01:01:01",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 -# HELP node_network_mtu_bytes mtu_bytes value of /sys/class/net/. +node_network_info{address="01:01:01:01:01:01",adminstate="up",broadcast="ff:ff:ff:ff:ff:ff",device="bond0",duplex="full",ifalias="",operstate="up"} 1 +node_network_info{address="01:01:01:01:01:01",adminstate="up",broadcast="ff:ff:ff:ff:ff:ff",device="eth0",duplex="full",ifalias="",operstate="up"} 1 +# HELP node_network_mtu_bytes Network device property: mtu_bytes # TYPE node_network_mtu_bytes gauge node_network_mtu_bytes{device="bond0"} 1500 node_network_mtu_bytes{device="eth0"} 1500 -# HELP node_network_name_assign_type name_assign_type value of /sys/class/net/. +# HELP node_network_name_assign_type Network device property: name_assign_type # TYPE node_network_name_assign_type gauge node_network_name_assign_type{device="bond0"} 2 node_network_name_assign_type{device="eth0"} 2 -# HELP node_network_net_dev_group net_dev_group value of /sys/class/net/. +# HELP node_network_net_dev_group Network device property: net_dev_group # TYPE node_network_net_dev_group gauge node_network_net_dev_group{device="bond0"} 0 node_network_net_dev_group{device="eth0"} 0 -# HELP node_network_protocol_type protocol_type value of /sys/class/net/. +# HELP node_network_protocol_type Network device property: protocol_type # TYPE node_network_protocol_type gauge node_network_protocol_type{device="bond0"} 1 node_network_protocol_type{device="eth0"} 1 @@ -2466,7 +2502,7 @@ node_network_receive_multicast_total{device="lo"} 0 node_network_receive_nohandler_total{device="lo"} 0 # HELP node_network_receive_packets_total Network device statistic receive_packets. # TYPE node_network_receive_packets_total counter -# HELP node_network_speed_bytes speed_bytes value of /sys/class/net/. +# HELP node_network_speed_bytes Network device property: speed_bytes # TYPE node_network_speed_bytes gauge node_network_speed_bytes{device="eth0"} 1.25e+08 # HELP node_network_transmit_bytes_total Network device statistic transmit_bytes. @@ -2491,7 +2527,7 @@ node_network_transmit_errs_total{device="lo"} 0 node_network_transmit_fifo_total{device="lo"} 0 # HELP node_network_transmit_packets_total Network device statistic transmit_packets. # TYPE node_network_transmit_packets_total counter -# HELP node_network_transmit_queue_length transmit_queue_length value of /sys/class/net/. +# HELP node_network_transmit_queue_length Network device property: transmit_queue_length # TYPE node_network_transmit_queue_length gauge node_network_transmit_queue_length{device="bond0"} 1000 node_network_transmit_queue_length{device="eth0"} 1000 @@ -2743,13 +2779,16 @@ node_nfsd_requests_total{method="SecInfo",proto="4"} 0 node_nfsd_requests_total{method="SetAttr",proto="2"} 0 node_nfsd_requests_total{method="SetAttr",proto="3"} 0 node_nfsd_requests_total{method="SetAttr",proto="4"} 0 +node_nfsd_requests_total{method="SetClientID",proto="4"} 3 +node_nfsd_requests_total{method="SetClientIDConfirm",proto="4"} 3 node_nfsd_requests_total{method="SymLink",proto="2"} 0 node_nfsd_requests_total{method="SymLink",proto="3"} 0 -node_nfsd_requests_total{method="Verify",proto="4"} 3 +node_nfsd_requests_total{method="Verify",proto="4"} 0 +node_nfsd_requests_total{method="WdelegGetattr",proto="4"} 15 node_nfsd_requests_total{method="WrCache",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="2"} 0 node_nfsd_requests_total{method="Write",proto="3"} 0 -node_nfsd_requests_total{method="Write",proto="4"} 3 +node_nfsd_requests_total{method="Write",proto="4"} 0 # HELP node_nfsd_rpc_errors_total Total number of NFSd RPC errors by error type. # TYPE node_nfsd_rpc_errors_total counter node_nfsd_rpc_errors_total{error="auth"} 2 @@ -2788,7 +2827,7 @@ node_power_supply_energy_watthour{power_supply="BAT0"} 36.58 # HELP node_power_supply_info info of /sys/class/power_supply/. # TYPE node_power_supply_info gauge node_power_supply_info{power_supply="AC",type="Mains"} 1 -node_power_supply_info{capacity_level="Normal",manufacturer="LGC",model_name="LNV-45N1�",power_supply="BAT0",serial_number="38109",status="Discharging",technology="Li-ion",type="Battery"} 1 +node_power_supply_info{capacity_level="Normal",manufacturer="LGC",model_name="LNV-45N1��",power_supply="BAT0",serial_number="38109",status="Discharging",technology="Li-ion",type="Battery"} 1 # HELP node_power_supply_online online value of /sys/class/power_supply/. # TYPE node_power_supply_online gauge node_power_supply_online{power_supply="AC"} 0 @@ -2899,6 +2938,7 @@ node_scrape_collector_success{collector="buddyinfo"} 1 node_scrape_collector_success{collector="cgroups"} 1 node_scrape_collector_success{collector="conntrack"} 1 node_scrape_collector_success{collector="cpu"} 1 +node_scrape_collector_success{collector="cpu_vulnerabilities"} 1 node_scrape_collector_success{collector="cpufreq"} 1 node_scrape_collector_success{collector="diskstats"} 1 node_scrape_collector_success{collector="dmi"} 1 @@ -2931,9 +2971,9 @@ node_scrape_collector_success{collector="processes"} 1 node_scrape_collector_success{collector="qdisc"} 1 node_scrape_collector_success{collector="rapl"} 1 node_scrape_collector_success{collector="schedstat"} 1 -node_scrape_collector_success{collector="selinux"} 1 node_scrape_collector_success{collector="slabinfo"} 1 node_scrape_collector_success{collector="sockstat"} 1 +node_scrape_collector_success{collector="softirqs"} 1 node_scrape_collector_success{collector="softnet"} 1 node_scrape_collector_success{collector="stat"} 1 node_scrape_collector_success{collector="sysctl"} 1 @@ -2943,13 +2983,12 @@ node_scrape_collector_success{collector="thermal_zone"} 1 node_scrape_collector_success{collector="time"} 1 node_scrape_collector_success{collector="udp_queues"} 1 node_scrape_collector_success{collector="vmstat"} 1 +node_scrape_collector_success{collector="watchdog"} 1 node_scrape_collector_success{collector="wifi"} 1 +node_scrape_collector_success{collector="xfrm"} 1 node_scrape_collector_success{collector="xfs"} 1 node_scrape_collector_success{collector="zfs"} 1 node_scrape_collector_success{collector="zoneinfo"} 1 -# HELP node_selinux_enabled SELinux is enabled, 1 is true, 0 is false -# TYPE node_selinux_enabled gauge -node_selinux_enabled 0 # HELP node_slabinfo_active_objects The number of objects that are currently active (i.e., in use). # TYPE node_slabinfo_active_objects gauge node_slabinfo_active_objects{slab="dmaengine-unmap-128"} 1206 @@ -3040,6 +3079,28 @@ node_sockstat_UDP_mem_bytes 0 # HELP node_sockstat_sockets_used Number of IPv4 sockets in use. # TYPE node_sockstat_sockets_used gauge node_sockstat_sockets_used 229 +# HELP node_softirqs_functions_total Softirq counts per CPU. +# TYPE node_softirqs_functions_total counter +node_softirqs_functions_total{cpu="0",type="BLOCK"} 23776 +node_softirqs_functions_total{cpu="0",type="HI"} 7 +node_softirqs_functions_total{cpu="0",type="HRTIMER"} 40 +node_softirqs_functions_total{cpu="0",type="IRQ_POLL"} 0 +node_softirqs_functions_total{cpu="0",type="NET_RX"} 43066 +node_softirqs_functions_total{cpu="0",type="NET_TX"} 2301 +node_softirqs_functions_total{cpu="0",type="RCU"} 155929 +node_softirqs_functions_total{cpu="0",type="SCHED"} 378895 +node_softirqs_functions_total{cpu="0",type="TASKLET"} 372 +node_softirqs_functions_total{cpu="0",type="TIMER"} 424191 +node_softirqs_functions_total{cpu="1",type="BLOCK"} 24115 +node_softirqs_functions_total{cpu="1",type="HI"} 1 +node_softirqs_functions_total{cpu="1",type="HRTIMER"} 346 +node_softirqs_functions_total{cpu="1",type="IRQ_POLL"} 0 +node_softirqs_functions_total{cpu="1",type="NET_RX"} 104508 +node_softirqs_functions_total{cpu="1",type="NET_TX"} 2430 +node_softirqs_functions_total{cpu="1",type="RCU"} 146631 +node_softirqs_functions_total{cpu="1",type="SCHED"} 152852 +node_softirqs_functions_total{cpu="1",type="TASKLET"} 1899 +node_softirqs_functions_total{cpu="1",type="TIMER"} 108342 # HELP node_softirqs_total Number of softirq calls. # TYPE node_softirqs_total counter node_softirqs_total{vector="block"} 186066 @@ -3052,18 +3113,42 @@ node_softirqs_total{vector="rcu"} 508444 node_softirqs_total{vector="sched"} 622196 node_softirqs_total{vector="tasklet"} 1.783454e+06 node_softirqs_total{vector="timer"} 1.481983e+06 +# HELP node_softnet_backlog_len Softnet backlog status +# TYPE node_softnet_backlog_len gauge +node_softnet_backlog_len{cpu="0"} 0 +node_softnet_backlog_len{cpu="1"} 0 +node_softnet_backlog_len{cpu="2"} 0 +node_softnet_backlog_len{cpu="3"} 0 +# HELP node_softnet_cpu_collision_total Number of collision occur while obtaining device lock while transmitting +# TYPE node_softnet_cpu_collision_total counter +node_softnet_cpu_collision_total{cpu="0"} 0 +node_softnet_cpu_collision_total{cpu="1"} 0 +node_softnet_cpu_collision_total{cpu="2"} 0 +node_softnet_cpu_collision_total{cpu="3"} 0 # HELP node_softnet_dropped_total Number of dropped packets # TYPE node_softnet_dropped_total counter node_softnet_dropped_total{cpu="0"} 0 node_softnet_dropped_total{cpu="1"} 41 node_softnet_dropped_total{cpu="2"} 0 node_softnet_dropped_total{cpu="3"} 0 +# HELP node_softnet_flow_limit_count_total Number of times flow limit has been reached +# TYPE node_softnet_flow_limit_count_total counter +node_softnet_flow_limit_count_total{cpu="0"} 0 +node_softnet_flow_limit_count_total{cpu="1"} 0 +node_softnet_flow_limit_count_total{cpu="2"} 0 +node_softnet_flow_limit_count_total{cpu="3"} 0 # HELP node_softnet_processed_total Number of processed packets # TYPE node_softnet_processed_total counter node_softnet_processed_total{cpu="0"} 299641 node_softnet_processed_total{cpu="1"} 916354 node_softnet_processed_total{cpu="2"} 5.577791e+06 node_softnet_processed_total{cpu="3"} 3.113785e+06 +# HELP node_softnet_received_rps_total Number of times cpu woken up received_rps +# TYPE node_softnet_received_rps_total counter +node_softnet_received_rps_total{cpu="0"} 0 +node_softnet_received_rps_total{cpu="1"} 0 +node_softnet_received_rps_total{cpu="2"} 0 +node_softnet_received_rps_total{cpu="3"} 0 # HELP node_softnet_times_squeezed_total Number of times processing packets ran out of quota # TYPE node_softnet_times_squeezed_total counter node_softnet_times_squeezed_total{cpu="0"} 1 @@ -3172,6 +3257,31 @@ node_vmstat_pswpin 1476 # HELP node_vmstat_pswpout /proc/vmstat information field pswpout. # TYPE node_vmstat_pswpout untyped node_vmstat_pswpout 35045 +# HELP node_watchdog_access_cs0 Value of /sys/class/watchdog//access_cs0 +# TYPE node_watchdog_access_cs0 gauge +node_watchdog_access_cs0{name="watchdog0"} 0 +# HELP node_watchdog_bootstatus Value of /sys/class/watchdog//bootstatus +# TYPE node_watchdog_bootstatus gauge +node_watchdog_bootstatus{name="watchdog0"} 1 +# HELP node_watchdog_fw_version Value of /sys/class/watchdog//fw_version +# TYPE node_watchdog_fw_version gauge +node_watchdog_fw_version{name="watchdog0"} 2 +# HELP node_watchdog_info Info of /sys/class/watchdog/ +# TYPE node_watchdog_info gauge +node_watchdog_info{identity="",name="watchdog1",options="",pretimeout_governor="",state="",status=""} 1 +node_watchdog_info{identity="Software Watchdog",name="watchdog0",options="0x8380",pretimeout_governor="noop",state="active",status="0x8000"} 1 +# HELP node_watchdog_nowayout Value of /sys/class/watchdog//nowayout +# TYPE node_watchdog_nowayout gauge +node_watchdog_nowayout{name="watchdog0"} 0 +# HELP node_watchdog_pretimeout_seconds Value of /sys/class/watchdog//pretimeout +# TYPE node_watchdog_pretimeout_seconds gauge +node_watchdog_pretimeout_seconds{name="watchdog0"} 120 +# HELP node_watchdog_timeleft_seconds Value of /sys/class/watchdog//timeleft +# TYPE node_watchdog_timeleft_seconds gauge +node_watchdog_timeleft_seconds{name="watchdog0"} 300 +# HELP node_watchdog_timeout_seconds Value of /sys/class/watchdog//timeout +# TYPE node_watchdog_timeout_seconds gauge +node_watchdog_timeout_seconds{name="watchdog0"} 60 # HELP node_wifi_interface_frequency_hertz The current frequency a WiFi interface is operating at, in hertz. # TYPE node_wifi_interface_frequency_hertz gauge node_wifi_interface_frequency_hertz{device="wlan0"} 2.412e+09 @@ -3219,6 +3329,90 @@ node_wifi_station_transmit_failed_total{device="wlan0",mac_address="aa:bb:cc:dd: # TYPE node_wifi_station_transmit_retries_total counter node_wifi_station_transmit_retries_total{device="wlan0",mac_address="01:02:03:04:05:06"} 20 node_wifi_station_transmit_retries_total{device="wlan0",mac_address="aa:bb:cc:dd:ee:ff"} 10 +# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use +# TYPE node_xfrm_acquire_error_packets_total counter +node_xfrm_acquire_error_packets_total 24532 +# HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed +# TYPE node_xfrm_fwd_hdr_error_packets_total counter +node_xfrm_fwd_hdr_error_packets_total 6654 +# HELP node_xfrm_in_buffer_error_packets_total No buffer is left +# TYPE node_xfrm_in_buffer_error_packets_total counter +node_xfrm_in_buffer_error_packets_total 2 +# HELP node_xfrm_in_error_packets_total All errors not matched by other +# TYPE node_xfrm_in_error_packets_total counter +node_xfrm_in_error_packets_total 1 +# HELP node_xfrm_in_hdr_error_packets_total Header error +# TYPE node_xfrm_in_hdr_error_packets_total counter +node_xfrm_in_hdr_error_packets_total 4 +# HELP node_xfrm_in_no_pols_packets_total No policy is found for states e.g. Inbound SAs are correct but no SP is found +# TYPE node_xfrm_in_no_pols_packets_total counter +node_xfrm_in_no_pols_packets_total 65432 +# HELP node_xfrm_in_no_states_packets_total No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong +# TYPE node_xfrm_in_no_states_packets_total counter +node_xfrm_in_no_states_packets_total 3 +# HELP node_xfrm_in_pol_block_packets_total Policy discards +# TYPE node_xfrm_in_pol_block_packets_total counter +node_xfrm_in_pol_block_packets_total 100 +# HELP node_xfrm_in_pol_error_packets_total Policy error +# TYPE node_xfrm_in_pol_error_packets_total counter +node_xfrm_in_pol_error_packets_total 10000 +# HELP node_xfrm_in_state_expired_packets_total State is expired +# TYPE node_xfrm_in_state_expired_packets_total counter +node_xfrm_in_state_expired_packets_total 7 +# HELP node_xfrm_in_state_invalid_packets_total State is invalid +# TYPE node_xfrm_in_state_invalid_packets_total counter +node_xfrm_in_state_invalid_packets_total 55555 +# HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch +# TYPE node_xfrm_in_state_mismatch_packets_total counter +node_xfrm_in_state_mismatch_packets_total 23451 +# HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error +# TYPE node_xfrm_in_state_mode_error_packets_total counter +node_xfrm_in_state_mode_error_packets_total 100 +# HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong +# TYPE node_xfrm_in_state_proto_error_packets_total counter +node_xfrm_in_state_proto_error_packets_total 40 +# HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window +# TYPE node_xfrm_in_state_seq_error_packets_total counter +node_xfrm_in_state_seq_error_packets_total 6000 +# HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong +# TYPE node_xfrm_in_tmpl_mismatch_packets_total counter +node_xfrm_in_tmpl_mismatch_packets_total 51 +# HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error +# TYPE node_xfrm_out_bundle_check_error_packets_total counter +node_xfrm_out_bundle_check_error_packets_total 555 +# HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error +# TYPE node_xfrm_out_bundle_gen_error_packets_total counter +node_xfrm_out_bundle_gen_error_packets_total 43321 +# HELP node_xfrm_out_error_packets_total All errors which is not matched others +# TYPE node_xfrm_out_error_packets_total counter +node_xfrm_out_error_packets_total 1e+06 +# HELP node_xfrm_out_no_states_packets_total No state is found +# TYPE node_xfrm_out_no_states_packets_total counter +node_xfrm_out_no_states_packets_total 869 +# HELP node_xfrm_out_pol_block_packets_total Policy discards +# TYPE node_xfrm_out_pol_block_packets_total counter +node_xfrm_out_pol_block_packets_total 43456 +# HELP node_xfrm_out_pol_dead_packets_total Policy is dead +# TYPE node_xfrm_out_pol_dead_packets_total counter +node_xfrm_out_pol_dead_packets_total 7656 +# HELP node_xfrm_out_pol_error_packets_total Policy error +# TYPE node_xfrm_out_pol_error_packets_total counter +node_xfrm_out_pol_error_packets_total 1454 +# HELP node_xfrm_out_state_expired_packets_total State is expired +# TYPE node_xfrm_out_state_expired_packets_total counter +node_xfrm_out_state_expired_packets_total 565 +# HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired +# TYPE node_xfrm_out_state_invalid_packets_total counter +node_xfrm_out_state_invalid_packets_total 28765 +# HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error +# TYPE node_xfrm_out_state_mode_error_packets_total counter +node_xfrm_out_state_mode_error_packets_total 8 +# HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error +# TYPE node_xfrm_out_state_proto_error_packets_total counter +node_xfrm_out_state_proto_error_packets_total 4542 +# HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow +# TYPE node_xfrm_out_state_seq_error_packets_total counter +node_xfrm_out_state_seq_error_packets_total 543 # HELP node_xfs_allocation_btree_compares_total Number of allocation B-tree compares for a filesystem. # TYPE node_xfs_allocation_btree_compares_total counter node_xfs_allocation_btree_compares_total{device="sda1"} 0 @@ -3672,193 +3866,193 @@ node_zfs_arc_prefetch_metadata_misses 16071 # HELP node_zfs_arc_size kstat.zfs.misc.arcstats.size # TYPE node_zfs_arc_size untyped node_zfs_arc_size 1.603939792e+09 -# HELP node_zfs_dbuf_dbuf_cache_count kstat.zfs.misc.dbuf_stats.dbuf_cache_count +# HELP node_zfs_dbuf_dbuf_cache_count kstat.zfs.misc.dbufstats.dbuf_cache_count # TYPE node_zfs_dbuf_dbuf_cache_count untyped node_zfs_dbuf_dbuf_cache_count 27 -# HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_hiwater_bytes +# HELP node_zfs_dbuf_dbuf_cache_hiwater_bytes kstat.zfs.misc.dbufstats.dbuf_cache_hiwater_bytes # TYPE node_zfs_dbuf_dbuf_cache_hiwater_bytes untyped node_zfs_dbuf_dbuf_cache_hiwater_bytes 6.9117804e+07 -# HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0 +# HELP node_zfs_dbuf_dbuf_cache_level_0 kstat.zfs.misc.dbufstats.dbuf_cache_level_0 # TYPE node_zfs_dbuf_dbuf_cache_level_0 untyped node_zfs_dbuf_dbuf_cache_level_0 27 -# HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_0_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_0_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_0_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_0_bytes untyped node_zfs_dbuf_dbuf_cache_level_0_bytes 302080 -# HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1 +# HELP node_zfs_dbuf_dbuf_cache_level_1 kstat.zfs.misc.dbufstats.dbuf_cache_level_1 # TYPE node_zfs_dbuf_dbuf_cache_level_1 untyped node_zfs_dbuf_dbuf_cache_level_1 0 -# HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10 +# HELP node_zfs_dbuf_dbuf_cache_level_10 kstat.zfs.misc.dbufstats.dbuf_cache_level_10 # TYPE node_zfs_dbuf_dbuf_cache_level_10 untyped node_zfs_dbuf_dbuf_cache_level_10 0 -# HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_10_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_10_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_10_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_10_bytes untyped node_zfs_dbuf_dbuf_cache_level_10_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11 +# HELP node_zfs_dbuf_dbuf_cache_level_11 kstat.zfs.misc.dbufstats.dbuf_cache_level_11 # TYPE node_zfs_dbuf_dbuf_cache_level_11 untyped node_zfs_dbuf_dbuf_cache_level_11 0 -# HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_11_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_11_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_11_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_11_bytes untyped node_zfs_dbuf_dbuf_cache_level_11_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_1_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_1_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_1_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_1_bytes untyped node_zfs_dbuf_dbuf_cache_level_1_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2 +# HELP node_zfs_dbuf_dbuf_cache_level_2 kstat.zfs.misc.dbufstats.dbuf_cache_level_2 # TYPE node_zfs_dbuf_dbuf_cache_level_2 untyped node_zfs_dbuf_dbuf_cache_level_2 0 -# HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_2_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_2_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_2_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_2_bytes untyped node_zfs_dbuf_dbuf_cache_level_2_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3 +# HELP node_zfs_dbuf_dbuf_cache_level_3 kstat.zfs.misc.dbufstats.dbuf_cache_level_3 # TYPE node_zfs_dbuf_dbuf_cache_level_3 untyped node_zfs_dbuf_dbuf_cache_level_3 0 -# HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_3_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_3_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_3_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_3_bytes untyped node_zfs_dbuf_dbuf_cache_level_3_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4 +# HELP node_zfs_dbuf_dbuf_cache_level_4 kstat.zfs.misc.dbufstats.dbuf_cache_level_4 # TYPE node_zfs_dbuf_dbuf_cache_level_4 untyped node_zfs_dbuf_dbuf_cache_level_4 0 -# HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_4_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_4_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_4_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_4_bytes untyped node_zfs_dbuf_dbuf_cache_level_4_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5 +# HELP node_zfs_dbuf_dbuf_cache_level_5 kstat.zfs.misc.dbufstats.dbuf_cache_level_5 # TYPE node_zfs_dbuf_dbuf_cache_level_5 untyped node_zfs_dbuf_dbuf_cache_level_5 0 -# HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_5_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_5_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_5_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_5_bytes untyped node_zfs_dbuf_dbuf_cache_level_5_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6 +# HELP node_zfs_dbuf_dbuf_cache_level_6 kstat.zfs.misc.dbufstats.dbuf_cache_level_6 # TYPE node_zfs_dbuf_dbuf_cache_level_6 untyped node_zfs_dbuf_dbuf_cache_level_6 0 -# HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_6_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_6_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_6_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_6_bytes untyped node_zfs_dbuf_dbuf_cache_level_6_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7 +# HELP node_zfs_dbuf_dbuf_cache_level_7 kstat.zfs.misc.dbufstats.dbuf_cache_level_7 # TYPE node_zfs_dbuf_dbuf_cache_level_7 untyped node_zfs_dbuf_dbuf_cache_level_7 0 -# HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_7_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_7_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_7_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_7_bytes untyped node_zfs_dbuf_dbuf_cache_level_7_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8 +# HELP node_zfs_dbuf_dbuf_cache_level_8 kstat.zfs.misc.dbufstats.dbuf_cache_level_8 # TYPE node_zfs_dbuf_dbuf_cache_level_8 untyped node_zfs_dbuf_dbuf_cache_level_8 0 -# HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_8_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_8_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_8_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_8_bytes untyped node_zfs_dbuf_dbuf_cache_level_8_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9 +# HELP node_zfs_dbuf_dbuf_cache_level_9 kstat.zfs.misc.dbufstats.dbuf_cache_level_9 # TYPE node_zfs_dbuf_dbuf_cache_level_9 untyped node_zfs_dbuf_dbuf_cache_level_9 0 -# HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_level_9_bytes +# HELP node_zfs_dbuf_dbuf_cache_level_9_bytes kstat.zfs.misc.dbufstats.dbuf_cache_level_9_bytes # TYPE node_zfs_dbuf_dbuf_cache_level_9_bytes untyped node_zfs_dbuf_dbuf_cache_level_9_bytes 0 -# HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_lowater_bytes +# HELP node_zfs_dbuf_dbuf_cache_lowater_bytes kstat.zfs.misc.dbufstats.dbuf_cache_lowater_bytes # TYPE node_zfs_dbuf_dbuf_cache_lowater_bytes untyped node_zfs_dbuf_dbuf_cache_lowater_bytes 5.6550932e+07 -# HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbuf_stats.dbuf_cache_max_bytes +# HELP node_zfs_dbuf_dbuf_cache_max_bytes kstat.zfs.misc.dbufstats.dbuf_cache_max_bytes # TYPE node_zfs_dbuf_dbuf_cache_max_bytes untyped node_zfs_dbuf_dbuf_cache_max_bytes 6.2834368e+07 -# HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbuf_stats.dbuf_cache_size +# HELP node_zfs_dbuf_dbuf_cache_size kstat.zfs.misc.dbufstats.dbuf_cache_size # TYPE node_zfs_dbuf_dbuf_cache_size untyped node_zfs_dbuf_dbuf_cache_size 302080 -# HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbuf_stats.dbuf_cache_size_max +# HELP node_zfs_dbuf_dbuf_cache_size_max kstat.zfs.misc.dbufstats.dbuf_cache_size_max # TYPE node_zfs_dbuf_dbuf_cache_size_max untyped node_zfs_dbuf_dbuf_cache_size_max 394240 -# HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbuf_stats.dbuf_cache_total_evicts +# HELP node_zfs_dbuf_dbuf_cache_total_evicts kstat.zfs.misc.dbufstats.dbuf_cache_total_evicts # TYPE node_zfs_dbuf_dbuf_cache_total_evicts untyped node_zfs_dbuf_dbuf_cache_total_evicts 0 -# HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbuf_stats.hash_chain_max +# HELP node_zfs_dbuf_hash_chain_max kstat.zfs.misc.dbufstats.hash_chain_max # TYPE node_zfs_dbuf_hash_chain_max untyped node_zfs_dbuf_hash_chain_max 0 -# HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbuf_stats.hash_chains +# HELP node_zfs_dbuf_hash_chains kstat.zfs.misc.dbufstats.hash_chains # TYPE node_zfs_dbuf_hash_chains untyped node_zfs_dbuf_hash_chains 0 -# HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbuf_stats.hash_collisions +# HELP node_zfs_dbuf_hash_collisions kstat.zfs.misc.dbufstats.hash_collisions # TYPE node_zfs_dbuf_hash_collisions untyped node_zfs_dbuf_hash_collisions 0 -# HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0 +# HELP node_zfs_dbuf_hash_dbuf_level_0 kstat.zfs.misc.dbufstats.hash_dbuf_level_0 # TYPE node_zfs_dbuf_hash_dbuf_level_0 untyped node_zfs_dbuf_hash_dbuf_level_0 37 -# HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_0_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_0_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_0_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_0_bytes untyped node_zfs_dbuf_hash_dbuf_level_0_bytes 465920 -# HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1 +# HELP node_zfs_dbuf_hash_dbuf_level_1 kstat.zfs.misc.dbufstats.hash_dbuf_level_1 # TYPE node_zfs_dbuf_hash_dbuf_level_1 untyped node_zfs_dbuf_hash_dbuf_level_1 10 -# HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10 +# HELP node_zfs_dbuf_hash_dbuf_level_10 kstat.zfs.misc.dbufstats.hash_dbuf_level_10 # TYPE node_zfs_dbuf_hash_dbuf_level_10 untyped node_zfs_dbuf_hash_dbuf_level_10 0 -# HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_10_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_10_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_10_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_10_bytes untyped node_zfs_dbuf_hash_dbuf_level_10_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11 +# HELP node_zfs_dbuf_hash_dbuf_level_11 kstat.zfs.misc.dbufstats.hash_dbuf_level_11 # TYPE node_zfs_dbuf_hash_dbuf_level_11 untyped node_zfs_dbuf_hash_dbuf_level_11 0 -# HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_11_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_11_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_11_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_11_bytes untyped node_zfs_dbuf_hash_dbuf_level_11_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_1_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_1_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_1_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_1_bytes untyped node_zfs_dbuf_hash_dbuf_level_1_bytes 1.31072e+06 -# HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2 +# HELP node_zfs_dbuf_hash_dbuf_level_2 kstat.zfs.misc.dbufstats.hash_dbuf_level_2 # TYPE node_zfs_dbuf_hash_dbuf_level_2 untyped node_zfs_dbuf_hash_dbuf_level_2 2 -# HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_2_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_2_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_2_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_2_bytes untyped node_zfs_dbuf_hash_dbuf_level_2_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3 +# HELP node_zfs_dbuf_hash_dbuf_level_3 kstat.zfs.misc.dbufstats.hash_dbuf_level_3 # TYPE node_zfs_dbuf_hash_dbuf_level_3 untyped node_zfs_dbuf_hash_dbuf_level_3 2 -# HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_3_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_3_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_3_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_3_bytes untyped node_zfs_dbuf_hash_dbuf_level_3_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4 +# HELP node_zfs_dbuf_hash_dbuf_level_4 kstat.zfs.misc.dbufstats.hash_dbuf_level_4 # TYPE node_zfs_dbuf_hash_dbuf_level_4 untyped node_zfs_dbuf_hash_dbuf_level_4 2 -# HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_4_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_4_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_4_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_4_bytes untyped node_zfs_dbuf_hash_dbuf_level_4_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5 +# HELP node_zfs_dbuf_hash_dbuf_level_5 kstat.zfs.misc.dbufstats.hash_dbuf_level_5 # TYPE node_zfs_dbuf_hash_dbuf_level_5 untyped node_zfs_dbuf_hash_dbuf_level_5 2 -# HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_5_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_5_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_5_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_5_bytes untyped node_zfs_dbuf_hash_dbuf_level_5_bytes 262144 -# HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6 +# HELP node_zfs_dbuf_hash_dbuf_level_6 kstat.zfs.misc.dbufstats.hash_dbuf_level_6 # TYPE node_zfs_dbuf_hash_dbuf_level_6 untyped node_zfs_dbuf_hash_dbuf_level_6 0 -# HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_6_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_6_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_6_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_6_bytes untyped node_zfs_dbuf_hash_dbuf_level_6_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7 +# HELP node_zfs_dbuf_hash_dbuf_level_7 kstat.zfs.misc.dbufstats.hash_dbuf_level_7 # TYPE node_zfs_dbuf_hash_dbuf_level_7 untyped node_zfs_dbuf_hash_dbuf_level_7 0 -# HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_7_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_7_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_7_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_7_bytes untyped node_zfs_dbuf_hash_dbuf_level_7_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8 +# HELP node_zfs_dbuf_hash_dbuf_level_8 kstat.zfs.misc.dbufstats.hash_dbuf_level_8 # TYPE node_zfs_dbuf_hash_dbuf_level_8 untyped node_zfs_dbuf_hash_dbuf_level_8 0 -# HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_8_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_8_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_8_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_8_bytes untyped node_zfs_dbuf_hash_dbuf_level_8_bytes 0 -# HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9 +# HELP node_zfs_dbuf_hash_dbuf_level_9 kstat.zfs.misc.dbufstats.hash_dbuf_level_9 # TYPE node_zfs_dbuf_hash_dbuf_level_9 untyped node_zfs_dbuf_hash_dbuf_level_9 0 -# HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbuf_stats.hash_dbuf_level_9_bytes +# HELP node_zfs_dbuf_hash_dbuf_level_9_bytes kstat.zfs.misc.dbufstats.hash_dbuf_level_9_bytes # TYPE node_zfs_dbuf_hash_dbuf_level_9_bytes untyped node_zfs_dbuf_hash_dbuf_level_9_bytes 0 -# HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbuf_stats.hash_elements +# HELP node_zfs_dbuf_hash_elements kstat.zfs.misc.dbufstats.hash_elements # TYPE node_zfs_dbuf_hash_elements untyped node_zfs_dbuf_hash_elements 55 -# HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbuf_stats.hash_elements_max +# HELP node_zfs_dbuf_hash_elements_max kstat.zfs.misc.dbufstats.hash_elements_max # TYPE node_zfs_dbuf_hash_elements_max untyped node_zfs_dbuf_hash_elements_max 55 -# HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbuf_stats.hash_hits +# HELP node_zfs_dbuf_hash_hits kstat.zfs.misc.dbufstats.hash_hits # TYPE node_zfs_dbuf_hash_hits untyped node_zfs_dbuf_hash_hits 108807 -# HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbuf_stats.hash_insert_race +# HELP node_zfs_dbuf_hash_insert_race kstat.zfs.misc.dbufstats.hash_insert_race # TYPE node_zfs_dbuf_hash_insert_race untyped node_zfs_dbuf_hash_insert_race 0 -# HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbuf_stats.hash_misses +# HELP node_zfs_dbuf_hash_misses kstat.zfs.misc.dbufstats.hash_misses # TYPE node_zfs_dbuf_hash_misses untyped node_zfs_dbuf_hash_misses 1851 # HELP node_zfs_dmu_tx_dmu_tx_assigned kstat.zfs.misc.dmu_tx.dmu_tx_assigned @@ -4177,16 +4371,25 @@ node_zfs_zpool_rupdate{zpool="poolz1"} 1.10734831944501e+14 # HELP node_zfs_zpool_state kstat.zfs.misc.state # TYPE node_zfs_zpool_state gauge node_zfs_zpool_state{state="degraded",zpool="pool1"} 0 +node_zfs_zpool_state{state="degraded",zpool="pool2"} 0 node_zfs_zpool_state{state="degraded",zpool="poolz1"} 1 node_zfs_zpool_state{state="faulted",zpool="pool1"} 0 +node_zfs_zpool_state{state="faulted",zpool="pool2"} 0 node_zfs_zpool_state{state="faulted",zpool="poolz1"} 0 node_zfs_zpool_state{state="offline",zpool="pool1"} 0 +node_zfs_zpool_state{state="offline",zpool="pool2"} 0 node_zfs_zpool_state{state="offline",zpool="poolz1"} 0 node_zfs_zpool_state{state="online",zpool="pool1"} 1 +node_zfs_zpool_state{state="online",zpool="pool2"} 0 node_zfs_zpool_state{state="online",zpool="poolz1"} 0 node_zfs_zpool_state{state="removed",zpool="pool1"} 0 +node_zfs_zpool_state{state="removed",zpool="pool2"} 0 node_zfs_zpool_state{state="removed",zpool="poolz1"} 0 +node_zfs_zpool_state{state="suspended",zpool="pool1"} 0 +node_zfs_zpool_state{state="suspended",zpool="pool2"} 1 +node_zfs_zpool_state{state="suspended",zpool="poolz1"} 0 node_zfs_zpool_state{state="unavail",zpool="pool1"} 0 +node_zfs_zpool_state{state="unavail",zpool="pool2"} 0 node_zfs_zpool_state{state="unavail",zpool="poolz1"} 0 # HELP node_zfs_zpool_wcnt kstat.zfs.misc.io.wcnt # TYPE node_zfs_zpool_wcnt untyped diff --git a/collector/fixtures/proc/interrupts_aarch64 b/collector/fixtures/proc/interrupts_aarch64 new file mode 100644 index 0000000000..88f2dea7e2 --- /dev/null +++ b/collector/fixtures/proc/interrupts_aarch64 @@ -0,0 +1,61 @@ + CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 + 10: 3287008667 3310445093 3301386305 3273132897 3368262064 3641875466 3360412019 3225020442 GICv3 27 Level arch_timer + 14: 7815 0 0 4 0 0 0 0 GICv3 37 Level ttyS0 + 17: 0 0 0 0 0 0 0 0 GICv3 48 Edge ACPI:Ged + 18: 0 0 0 0 0 0 0 0 GICv3 49 Edge ACPI:Ged + 19: 0 0 0 0 0 0 0 0 GICv3 50 Edge ACPI:Ged + 20: 0 0 0 0 0 0 0 0 GICv3 51 Edge ACPI:Ged + 21: 0 0 0 0 0 0 0 0 GICv3 52 Edge ACPI:Ged + 22: 0 0 0 0 0 0 0 0 GICv3 53 Edge ACPI:Ged + 23: 0 0 0 0 0 0 0 0 GICv3 54 Edge ACPI:Ged + 24: 0 0 0 0 0 0 0 0 GICv3 55 Edge ACPI:Ged + 25: 0 0 0 0 0 0 0 0 GICv3 56 Edge ACPI:Ged + 26: 0 0 0 0 0 0 0 0 GICv3 57 Edge ACPI:Ged + 27: 0 0 0 0 0 0 0 0 GICv3 58 Edge ACPI:Ged + 28: 0 0 0 0 0 0 0 0 GICv3 59 Edge ACPI:Ged + 29: 0 0 0 0 0 0 0 0 GICv3 60 Edge ACPI:Ged + 30: 0 0 0 0 0 0 0 0 GICv3 61 Edge ACPI:Ged + 31: 0 0 0 0 0 0 0 0 GICv3 62 Edge ACPI:Ged + 32: 0 0 0 0 0 0 0 0 GICv3 63 Edge ACPI:Ged + 33: 0 0 0 0 0 0 0 0 GICv3 64 Edge ACPI:Ged + 34: 0 0 0 0 0 0 0 0 GICv3 65 Edge ACPI:Ged + 35: 0 0 0 0 0 0 0 0 GICv3 66 Edge ACPI:Ged + 36: 0 0 0 0 0 0 0 0 GICv3 67 Edge ACPI:Ged + 37: 0 0 0 0 0 0 0 0 GICv3 68 Edge ACPI:Ged + 38: 0 0 0 0 0 0 0 0 GICv3 69 Edge ACPI:Ged + 39: 0 0 0 0 0 0 0 0 GICv3 70 Edge ACPI:Ged + 40: 0 0 0 0 0 0 0 0 GICv3 71 Edge ACPI:Ged + 41: 0 0 0 0 0 0 0 0 GICv3 72 Edge ACPI:Ged + 42: 0 0 0 0 0 0 0 0 GICv3 73 Edge ACPI:Ged + 43: 0 0 0 0 0 0 0 0 GICv3 74 Edge ACPI:Ged + 44: 0 0 0 0 0 0 0 0 GICv3 75 Edge ACPI:Ged + 45: 0 0 0 0 0 0 0 0 GICv3 76 Edge ACPI:Ged + 46: 0 0 0 0 0 0 0 0 GICv3 77 Edge ACPI:Ged + 47: 0 0 0 0 0 0 0 0 GICv3 78 Edge ACPI:Ged + 48: 0 0 0 0 0 0 0 0 GICv3 79 Edge ACPI:Ged + 49: 0 0 0 0 0 0 0 0 GICv3 23 Level arm-pmu + 50: 0 0 0 0 0 0 0 0 ARMH0061:00 3 Edge ACPI:Event + 51: 13 0 0 20 4 0 0 0 ITS-MSI 65536 Edge nvme0q0 + 52: 0 9 0 0 0 5 20 0 ITS-MSI 507904 Edge nvme1q0 + 53: 129969327 0 0 0 0 0 0 0 ITS-MSI 65537 Edge nvme0q1 + 54: 0 0 0 0 126913956 0 0 0 ITS-MSI 65538 Edge nvme0q2 + 55: 0 199619844 0 0 0 0 0 0 ITS-MSI 507905 Edge nvme1q1 + 56: 0 0 0 0 0 198494086 0 0 ITS-MSI 507906 Edge nvme1q2 + 57: 0 0 51 0 0 32479308 0 0 ITS-MSI 81920 Edge ena-mgmnt@pci:0000:00:05.0 + 58: 0 0 1195697946 437 0 0 0 0 ITS-MSI 81921 Edge eth0-Tx-Rx-0 + 59: 0 0 0 2709937608 1619 0 0 0 ITS-MSI 81922 Edge eth0-Tx-Rx-1 + 60: 0 1457922109 0 0 0 71 0 0 ITS-MSI 81923 Edge eth0-Tx-Rx-2 + 61: 2052879736 0 0 0 0 0 124 0 ITS-MSI 81924 Edge eth0-Tx-Rx-3 + 62: 0 0 0 0 0 0 2268695629 1530 ITS-MSI 81925 Edge eth0-Tx-Rx-4 + 63: 50 0 0 0 0 0 0 1997799253 ITS-MSI 81926 Edge eth0-Tx-Rx-5 + 64: 0 48 0 0 1238622585 0 0 0 ITS-MSI 81927 Edge eth0-Tx-Rx-6 + 65: 0 0 47 0 0 0 0 1574978449 ITS-MSI 81928 Edge eth0-Tx-Rx-7 +IPI0:2768808080 2844211768 2878602432 2730576120 2723524623 3349096412 2717389879 2154252810 Rescheduling interrupts +IPI1: 357815098 213258177 153713187 132890624 124746406 123498004 122386326 120728639 Function call interrupts +IPI2: 0 0 0 0 0 0 0 0 CPU stop interrupts +IPI3: 0 0 0 0 0 0 0 0 CPU stop (for crash dump) interrupts +IPI4: 0 0 0 0 0 0 0 0 Timer broadcast interrupts +IPI5: 0 0 0 0 0 0 0 0 IRQ work interrupts +IPI6: 0 0 0 0 0 0 0 0 CPU wake-up interrupts +Err: 0 + diff --git a/collector/fixtures/proc/net/netstat b/collector/fixtures/proc/net/netstat index 811f623273..de88470bdd 100644 --- a/collector/fixtures/proc/net/netstat +++ b/collector/fixtures/proc/net/netstat @@ -1,4 +1,4 @@ -TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPChallengeACK TCPSYNChallenge -TcpExt: 0 0 2 0 0 0 0 0 0 0 388812 0 0 0 0 6 102471 17 9 0 0 80568 0 168808 0 4471289 26 1433940 3744565 0 1 0 0 0 0 0 0 0 0 48 0 0 0 1 0 1 0 1 115 0 0 0 0 9 0 5 0 41 4 0 0 0 0 0 0 0 1 0 0 0 0 2 5 0 0 0 0 0 0 0 2 2 +TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog TCPDirectCopyFromPrequeue TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPChallengeACK TCPSYNChallenge TCPOFOQueue +TcpExt: 0 0 2 0 0 0 0 0 0 0 388812 0 0 0 0 6 102471 17 9 0 0 80568 0 168808 0 4471289 26 1433940 3744565 0 1 0 0 0 0 0 0 0 0 48 0 0 0 1 0 1 0 1 115 0 0 0 0 9 0 5 0 41 4 0 0 0 0 0 0 0 1 0 0 0 0 2 5 0 0 0 0 0 0 0 2 2 42 IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets IpExt: 0 0 0 0 0 0 6286396970 2786264347 0 0 0 0 diff --git a/collector/fixtures/proc/net/rpc/nfsd b/collector/fixtures/proc/net/rpc/nfsd index 754f19d9d5..6a092bfd30 100644 --- a/collector/fixtures/proc/net/rpc/nfsd +++ b/collector/fixtures/proc/net/rpc/nfsd @@ -9,3 +9,4 @@ proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2 proc3 22 2 112 0 2719 111 0 0 0 0 0 0 0 0 0 0 0 27 216 0 2 1 0 proc4 2 2 10853 proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +wdeleg_getattr 15 diff --git a/collector/fixtures/proc/net/xfrm_stat b/collector/fixtures/proc/net/xfrm_stat new file mode 100644 index 0000000000..970c3e4ded --- /dev/null +++ b/collector/fixtures/proc/net/xfrm_stat @@ -0,0 +1,28 @@ +XfrmInError 1 +XfrmInBufferError 2 +XfrmInHdrError 4 +XfrmInNoStates 3 +XfrmInStateProtoError 40 +XfrmInStateModeError 100 +XfrmInStateSeqError 6000 +XfrmInStateExpired 7 +XfrmInStateMismatch 23451 +XfrmInStateInvalid 55555 +XfrmInTmplMismatch 51 +XfrmInNoPols 65432 +XfrmInPolBlock 100 +XfrmInPolError 10000 +XfrmOutError 1000000 +XfrmOutBundleGenError 43321 +XfrmOutBundleCheckError 555 +XfrmOutNoStates 869 +XfrmOutStateProtoError 4542 +XfrmOutStateModeError 8 +XfrmOutStateSeqError 543 +XfrmOutStateExpired 565 +XfrmOutPolBlock 43456 +XfrmOutPolDead 7656 +XfrmOutPolError 1454 +XfrmFwdHdrError 6654 +XfrmOutStateInvalid 28765 +XfrmAcquireError 24532 \ No newline at end of file diff --git a/collector/fixtures/proc/pressure/cpu b/collector/fixtures/proc/pressure/cpu index 14acc3a325..0aaced93da 100644 --- a/collector/fixtures/proc/pressure/cpu +++ b/collector/fixtures/proc/pressure/cpu @@ -1 +1,2 @@ some avg10=0.00 avg60=0.00 avg300=0.00 total=14036781 +full avg10=0.00 avg60=0.00 avg300=0.00 total=0 diff --git a/collector/fixtures/proc/softirqs b/collector/fixtures/proc/softirqs new file mode 100644 index 0000000000..a1dfef5ffe --- /dev/null +++ b/collector/fixtures/proc/softirqs @@ -0,0 +1,11 @@ + CPU0 CPU1 + HI: 7 1 + TIMER: 424191 108342 + NET_TX: 2301 2430 + NET_RX: 43066 104508 + BLOCK: 23776 24115 + IRQ_POLL: 0 0 + TASKLET: 372 1899 + SCHED: 378895 152852 + HRTIMER: 40 346 + RCU: 155929 146631 diff --git a/collector/fixtures/proc/spl/kstat/zfs/dbuf_stats b/collector/fixtures/proc/spl/kstat/zfs/dbufstats similarity index 100% rename from collector/fixtures/proc/spl/kstat/zfs/dbuf_stats rename to collector/fixtures/proc/spl/kstat/zfs/dbufstats diff --git a/collector/fixtures/proc/spl/kstat/zfs/pool2/state b/collector/fixtures/proc/spl/kstat/zfs/pool2/state new file mode 100644 index 0000000000..c3ddd0e661 --- /dev/null +++ b/collector/fixtures/proc/spl/kstat/zfs/pool2/state @@ -0,0 +1 @@ +SUSPENDED diff --git a/collector/fixtures/sys.ttar b/collector/fixtures/sys.ttar index b837f3dd47..2cac29e493 100644 --- a/collector/fixtures/sys.ttar +++ b/collector/fixtures/sys.ttar @@ -141,7 +141,7 @@ Mode: 400 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/dmi/id/product_version Lines: 1 -À[‡ +�[� Mode: 444 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/dmi/id/sys_vendor @@ -288,6 +288,87 @@ Lines: 1 Emulex SN1100E2P FV12.4.270.3 DV12.4.0.0. HN:gotest. OS:Linux Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/class/fc_host/host1 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/speed +Lines: 1 +8 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/class/fc_host/host1/statistics +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/dumped_frames +Lines: 1 +0x0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/error_frames +Lines: 1 +0x13 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/fcp_packet_aborts +Lines: 1 +0xffffffffffffffff +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/invalid_crc_count +Lines: 1 +0x20 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/invalid_tx_word_count +Lines: 1 +0x80 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/link_failure_count +Lines: 1 +0x90 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/loss_of_signal_count +Lines: 1 +0x110 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/loss_of_sync_count +Lines: 1 +0x100 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/nos_count +Lines: 1 +0x120 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/rx_frames +Lines: 1 +0x30 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/rx_words +Lines: 1 +0x40 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/seconds_since_last_reset +Lines: 1 +0x70 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/tx_frames +Lines: 1 +0x50 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/fc_host/host1/statistics/tx_words +Lines: 1 +0x60 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/hwmon Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -356,6 +437,9 @@ Lines: 1 100000 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/hwmon/hwmon5 +SymlinkTo: ../../devices/platform/bogus.0/hwmon/hwmon5/ +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/infiniband Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1440,7 +1524,7 @@ Mode: 444 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/class/power_supply/BAT0/model_name Lines: 1 -LNV-45N1ÀÀ +LNV-45N1�� Mode: 444 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/class/power_supply/BAT0/power @@ -1714,6 +1798,75 @@ SymlinkTo: ../../devices/virtual/thermal/cooling_device0 Path: sys/class/thermal/thermal_zone0 SymlinkTo: ../../devices/virtual/thermal/thermal_zone0 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/class/watchdog +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/class/watchdog/watchdog0 +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/access_cs0 +Lines: 1 +0EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/bootstatus +Lines: 1 +1EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/fw_version +Lines: 1 +2EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/identity +Lines: 1 +Software WatchdogEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/nowayout +Lines: 1 +0EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/options +Lines: 1 +0x8380EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/pretimeout +Lines: 1 +120EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/pretimeout_governor +Lines: 1 +noopEOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/state +Lines: 1 +activeEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/status +Lines: 1 +0x8000EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/timeleft +Lines: 1 +300EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/class/watchdog/watchdog0/timeout +Lines: 1 +60EOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/class/watchdog/watchdog1 +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2396,7 +2549,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute @@ -2439,7 +2592,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour @@ -2482,7 +2635,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total @@ -2525,7 +2678,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/writeback_rate_debug @@ -2672,6 +2825,45 @@ Lines: 1 applesmc Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/devices/platform/bogus.0 +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/devices/platform/bogus.0/hwmon +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/devices/platform/bogus.0/hwmon/hwmon5 +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/bogus1_crit +Lines: 1 +100000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/bogus1_crit_alarm +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/bogus1_input +Lines: 1 +55000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/bogus1_label +Lines: 1 +Physical id 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/bogus1_max +Lines: 1 +84000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/platform/bogus.0/hwmon/hwmon5/name +Lines: 1 +bogus +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/platform/coretemp.0 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3545,6 +3737,44 @@ Lines: 1 1,3-5,9 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/offline +Lines: 1 + +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/online +Lines: 1 +0-3 +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: sys/devices/system/cpu/vulnerabilities +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/vulnerabilities/itlb_multihit +Lines: 1 +Not affected +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/vulnerabilities/mds +Lines: 1 +Vulnerable +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/vulnerabilities/retbleed +Lines: 1 +Mitigation: untrained return thunk; SMT enabled with STIBP protection +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/vulnerabilities/spectre_v1 +Lines: 1 +Mitigation: usercopy/swapgs barriers and __user pointer sanitization +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: sys/devices/system/cpu/vulnerabilities/spectre_v2 +Lines: 1 +Mitigation: Retpolines, IBPB: conditional, STIBP: always-on, RSB filling, PBRSB-eIBRS: Not affected +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/devices/system/edac Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3900,7 +4130,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute @@ -3943,7 +4173,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour @@ -3986,7 +4216,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total @@ -4029,7 +4259,7 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_readaheads Lines: 1 -0 +13 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/tree_depth diff --git a/collector/fixtures/textfile/metrics_merge_different_help.out b/collector/fixtures/textfile/metrics_merge_different_help.out index ba161f0779..b9385a752a 100644 --- a/collector/fixtures/textfile/metrics_merge_different_help.out +++ b/collector/fixtures/textfile/metrics_merge_different_help.out @@ -8,4 +8,4 @@ node_textfile_mtime_seconds{file="fixtures/textfile/metrics_merge_different_help node_textfile_mtime_seconds{file="fixtures/textfile/metrics_merge_different_help/b.prom"} 1 # HELP node_textfile_scrape_error 1 if there was an error opening or reading a file, 0 otherwise # TYPE node_textfile_scrape_error gauge -node_textfile_scrape_error 0 +node_textfile_scrape_error 1 diff --git a/collector/fixtures/udev.ttar b/collector/fixtures/udev.ttar new file mode 100644 index 0000000000..f4db1d901c --- /dev/null +++ b/collector/fixtures/udev.ttar @@ -0,0 +1,529 @@ +# Archive created by ttar -C collector/fixtures -c -f collector/fixtures/udev.ttar udev +Directory: udev +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: udev/data +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b11:0 +Lines: 38 +S:disk/by-id/usb-AMI_Virtual_CDROM0_AAAABBBBCCCC1-0:0 +S:disk/by-path/pci-0000:00:14.0-usb-0:1.1:1.0-scsi-0:0:0:0 +S:cdrom +L:-100 +I:83543243 +E:ID_CDROM=1 +E:SYSTEMD_MOUNT_DEVICE_BOUND=1 +E:ID_VENDOR=AMI +E:ID_VENDOR_ENC=AMI\x20\x20\x20\x20\x20 +E:ID_VENDOR_ID=c096 +E:ID_MODEL=Virtual_CDROM0 +E:ID_MODEL_ENC=Virtual\x20CDROM0\x20\x20 +E:ID_MODEL_ID=ee31 +E:ID_REVISION=1.00 +E:ID_SERIAL=AMI_Virtual_CDROM0_AAAABBBBCCCC1-0:0 +E:ID_SERIAL_SHORT=AAAABBBBCCCC1 +E:ID_TYPE=cd/dvd +E:ID_INSTANCE=0:0 +E:ID_BUS=usb +E:ID_USB_INTERFACES=:905639: +E:ID_USB_INTERFACE_NUM=00 +E:ID_USB_DRIVER=usb-storage +E:ID_PATH=pci-0000:00:14.0-usb-0:1.1:1.0-scsi-0:0:0:0 +E:ID_PATH_TAG=pci-0000_00_14_0-usb-0_1_1_1_0-scsi-0_0_0_0 +E:SCSI_TPGS=0 +E:SCSI_TYPE=cd/dvd +E:SCSI_VENDOR=AMI +E:SCSI_VENDOR_ENC=AMI\x20\x20\x20\x20\x20 +E:SCSI_MODEL=Virtual_CDROM0 +E:SCSI_MODEL_ENC=Virtual\x20CDROM0\x20\x20 +E:SCSI_REVISION=1.00 +E:ID_SCSI=1 +E:ID_SCSI_INQUIRY=1 +E:ID_FS_TYPE= +E:ID_FOR_SEAT=block-pci-0000_00_14_0-usb-0_1_1_1_0-scsi-0_0_0_0 +G:uaccess +G:systemd +G:seat +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b179:0 +Lines: 13 +S:disk/by-path/platform-df2969f3.mmc +S:disk/by-id/mmc-SC64G_0x83e36d93 +W:1 +I:7679747 +E:ID_NAME=SC64G +E:ID_SERIAL=0x83e36d93 +E:ID_PATH=platform-df2969f3.mmc +E:ID_PATH_TAG=platform-df2969f3_mmc +E:ID_PART_TABLE_UUID=1954c9df +E:ID_PART_TABLE_TYPE=dos +E:ID_DRIVE_FLASH_SD=1 +E:ID_DRIVE_MEDIA_FLASH_SD=1 +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b179:1 +Lines: 30 +S:disk/by-id/mmc-SC64G_0x83e36d93-part1 +S:disk/by-path/platform-df2969f3.mmc-part1 +S:disk/by-label/boot +S:disk/by-uuid/6284-658D +S:disk/by-partuuid/1954c9df-01 +W:12 +I:8463403 +E:ID_NAME=SC64G +E:ID_SERIAL=0x83e36d93 +E:ID_PATH=platform-df2969f3.mmc +E:ID_PATH_TAG=platform-df2969f3_mmc +E:ID_PART_TABLE_UUID=1954c9df +E:ID_PART_TABLE_TYPE=dos +E:ID_DRIVE_FLASH_SD=1 +E:ID_DRIVE_MEDIA_FLASH_SD=1 +E:ID_FS_LABEL=boot +E:ID_FS_LABEL_ENC=boot +E:ID_FS_UUID=6284-658D +E:ID_FS_UUID_ENC=6284-658D +E:ID_FS_VERSION=FAT32 +E:ID_FS_TYPE=vfat +E:ID_FS_USAGE=filesystem +E:ID_PART_ENTRY_SCHEME=dos +E:ID_PART_ENTRY_UUID=1954c9df-01 +E:ID_PART_ENTRY_TYPE=0xc +E:ID_PART_ENTRY_NUMBER=1 +E:ID_PART_ENTRY_OFFSET=8192 +E:ID_PART_ENTRY_SIZE=524288 +E:ID_PART_ENTRY_DISK=179:0 +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b179:2 +Lines: 30 +S:disk/by-id/mmc-SC64G_0x83e36d93-part2 +S:disk/by-path/platform-df2969f3.mmc-part2 +S:disk/by-label/rootfs +S:disk/by-uuid/83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 +S:disk/by-partuuid/1954c9df-02 +W:2 +I:7676649 +E:ID_NAME=SC64G +E:ID_SERIAL=0x83e36d93 +E:ID_PATH=platform-df2969f3.mmc +E:ID_PATH_TAG=platform-df2969f3_mmc +E:ID_PART_TABLE_UUID=1954c9df +E:ID_PART_TABLE_TYPE=dos +E:ID_DRIVE_FLASH_SD=1 +E:ID_DRIVE_MEDIA_FLASH_SD=1 +E:ID_FS_LABEL=rootfs +E:ID_FS_LABEL_ENC=rootfs +E:ID_FS_UUID=83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 +E:ID_FS_UUID_ENC=83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 +E:ID_FS_VERSION=1.0 +E:ID_FS_TYPE=ext4 +E:ID_FS_USAGE=filesystem +E:ID_PART_ENTRY_SCHEME=dos +E:ID_PART_ENTRY_UUID=1954c9df-02 +E:ID_PART_ENTRY_TYPE=0x83 +E:ID_PART_ENTRY_NUMBER=2 +E:ID_PART_ENTRY_OFFSET=532480 +E:ID_PART_ENTRY_SIZE=124203008 +E:ID_PART_ENTRY_DISK=179:0 +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:0 +Lines: 20 +S:disk/by-id/dm-name-nvme0n1_crypt +S:mapper/nvme0n1_crypt +S:disk/by-id/lvm-pv-uuid-c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB +S:disk/by-id/dm-uuid-CRYPT-LUKS2-jolaulot80fy9zsiobkxyxo7y2dqeho2-nvme0n1_crypt +I:72859885 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=nvme0n1_crypt +E:DM_UUID=CRYPT-LUKS2-jolaulot80fy9zsiobkxyxo7y2dqeho2-nvme0n1_crypt +E:DM_SUSPENDED=0 +E:ID_FS_UUID=c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB +E:ID_FS_UUID_ENC=c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB +E:ID_FS_VERSION=LVM2 001 +E:ID_FS_TYPE=LVM2_member +E:ID_FS_USAGE=raid +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:1 +Lines: 24 +S:disk/by-id/dm-uuid-LVM-wbGqQEBL9SxrW2DLntJwgg8fAv946hw3Tvjqh0v31fWgxEtD4BoHO0lROWFUY65T +S:mapper/system-swap_1 +S:disk/by-id/dm-name-system-swap_1 +S:disk/by-uuid/5272bb60-04b5-49cd-b730-be57c7604450 +S:system/swap_1 +I:78705530 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=system-swap_1 +E:DM_UUID=LVM-wbGqQEBL9SxrW2DLntJwgg8fAv946hw3Tvjqh0v31fWgxEtD4BoHO0lROWFUY65T +E:DM_SUSPENDED=0 +E:DM_VG_NAME=system +E:DM_LV_NAME=swap_1 +E:DM_LV_LAYER= +E:ID_FS_UUID=5272bb60-04b5-49cd-b730-be57c7604450 +E:ID_FS_UUID_ENC=5272bb60-04b5-49cd-b730-be57c7604450 +E:ID_FS_VERSION=1 +E:ID_FS_TYPE=swap +E:ID_FS_USAGE=other +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:2 +Lines: 24 +S:disk/by-id/dm-name-system-root +S:disk/by-id/dm-uuid-LVM-NWEDo8q5ABDyJuC3F8veKNyWfYmeIBfFMS4MF3HakzUhkk7ekDm6fJTHkl2fYHe7 +S:mapper/system-root +S:disk/by-uuid/3deafd0d-faff-4695-8d15-51061ae1f51b +S:system/root +I:77655410 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=system-root +E:DM_UUID=LVM-NWEDo8q5ABDyJuC3F8veKNyWfYmeIBfFMS4MF3HakzUhkk7ekDm6fJTHkl2fYHe7 +E:DM_SUSPENDED=0 +E:DM_VG_NAME=system +E:DM_LV_NAME=root +E:DM_LV_LAYER= +E:ID_FS_UUID=3deafd0d-faff-4695-8d15-51061ae1f51b +E:ID_FS_UUID_ENC=3deafd0d-faff-4695-8d15-51061ae1f51b +E:ID_FS_VERSION=1.0 +E:ID_FS_TYPE=ext4 +E:ID_FS_USAGE=filesystem +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:3 +Lines: 24 +S:disk/by-id/dm-name-system-var +S:disk/by-id/dm-uuid-LVM-hrxHo0rlZ6U95ku5841Lpd17bS1Z7V7lrtEE60DVgE6YEOCdS9gcDGyonWim4hGP +S:mapper/system-var +S:disk/by-uuid/5c772222-f7d4-4c8e-87e8-e97df6b7a45e +S:system/var +I:79395348 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=system-var +E:DM_UUID=LVM-hrxHo0rlZ6U95ku5841Lpd17bS1Z7V7lrtEE60DVgE6YEOCdS9gcDGyonWim4hGP +E:DM_SUSPENDED=0 +E:DM_VG_NAME=system +E:DM_LV_NAME=var +E:DM_LV_LAYER= +E:ID_FS_UUID=5c772222-f7d4-4c8e-87e8-e97df6b7a45e +E:ID_FS_UUID_ENC=5c772222-f7d4-4c8e-87e8-e97df6b7a45e +E:ID_FS_VERSION=1.0 +E:ID_FS_TYPE=ext4 +E:ID_FS_USAGE=filesystem +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:4 +Lines: 24 +S:system/tmp +S:disk/by-uuid/a9479d44-60e1-4015-a1e5-bb065e6dd11b +S:disk/by-id/dm-uuid-LVM-XTNGOHjPWLHcxmJmVu5cWTXEtuzqDeBkdEHAZW5q9LxWQ2d4mb5CchUQzUPJpl8H +S:mapper/system-tmp +S:disk/by-id/dm-name-system-tmp +I:75852450 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=system-tmp +E:DM_UUID=LVM-XTNGOHjPWLHcxmJmVu5cWTXEtuzqDeBkdEHAZW5q9LxWQ2d4mb5CchUQzUPJpl8H +E:DM_SUSPENDED=0 +E:DM_VG_NAME=system +E:DM_LV_NAME=tmp +E:DM_LV_LAYER= +E:ID_FS_UUID=a9479d44-60e1-4015-a1e5-bb065e6dd11b +E:ID_FS_UUID_ENC=a9479d44-60e1-4015-a1e5-bb065e6dd11b +E:ID_FS_VERSION=1.0 +E:ID_FS_TYPE=ext4 +E:ID_FS_USAGE=filesystem +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b252:5 +Lines: 24 +S:disk/by-uuid/b05b726a-c718-4c4d-8641-7c73a7696d83 +S:mapper/system-home +S:system/home +S:disk/by-id/dm-name-system-home +S:disk/by-id/dm-uuid-LVM-MtoJaWTpjWRXlUnNFlpxZauTEuYlMvGFutigEzCCrfj8CNh6jCRi5LQJXZCpLjPf +I:72604009 +E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 +E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 +E:DM_UDEV_RULES=1 +E:DM_UDEV_RULES_VSN=2 +E:DM_NAME=system-home +E:DM_UUID=LVM-MtoJaWTpjWRXlUnNFlpxZauTEuYlMvGFutigEzCCrfj8CNh6jCRi5LQJXZCpLjPf +E:DM_SUSPENDED=0 +E:DM_VG_NAME=system +E:DM_LV_NAME=home +E:DM_LV_LAYER= +E:ID_FS_UUID=b05b726a-c718-4c4d-8641-7c73a7696d83 +E:ID_FS_UUID_ENC=b05b726a-c718-4c4d-8641-7c73a7696d83 +E:ID_FS_VERSION=1.0 +E:ID_FS_TYPE=ext4 +E:ID_FS_USAGE=filesystem +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b254:0 +Lines: 10 +S:disk/by-path/pci-0000:00:06.0 +S:disk/by-path/virtio-pci-0000:00:06.0 +W:1 +I:8524171 +E:ID_PATH=pci-0000:00:06.0 +E:ID_PATH_TAG=pci-0000_00_06_0 +E:ID_PART_TABLE_UUID=653b59fd +E:ID_PART_TABLE_TYPE=dos +E:ID_FS_TYPE= +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b259:0 +Lines: 17 +S:disk/by-path/pci-0000:02:00.0-nvme-1 +S:disk/by-id/nvme-eui.p3vbbiejx5aae2r3 +S:disk/by-id/nvme-SAMSUNG_EHFTF55LURSY-000Y9_S252B6CU1HG3M1 +I:79621327 +E:ID_SERIAL_SHORT=S252B6CU1HG3M1 +E:ID_WWN=eui.p3vbbiejx5aae2r3 +E:ID_MODEL=SAMSUNG EHFTF55LURSY-000Y9 +E:ID_REVISION=4NBTUY95 +E:ID_SERIAL=SAMSUNG_EHFTF55LURSY-000Y9_S252B6CU1HG3M1 +E:ID_PATH=pci-0000:02:00.0-nvme-1 +E:ID_PATH_TAG=pci-0000_02_00_0-nvme-1 +E:ID_PART_TABLE_UUID=f301fdbd-fd1f-46d4-9fb8-c9aeb757f050 +E:ID_PART_TABLE_TYPE=gpt +E:ID_FS_TYPE= +G:systemd +Q:systemd +V:1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b8:0 +Lines: 60 +S:disk/by-id/lvm-pv-uuid-cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw +S:disk/by-id/scsi-SATA_TOSHIBA_KSDB4U86_2160A0D5FVGG +S:disk/by-id/ata-TOSHIBA_KSDB4U866TE_2160A0D5FVGG +S:disk/by-path/pci-0000:3b:00.0-sas-phy7-lun-0 +S:disk/by-id/scsi-37c72382b8de36a64 +S:disk/by-id/wwn-0x7c72382b8de36a64 +W:702 +I:73815117 +E:ID_ATA=1 +E:ID_TYPE=disk +E:ID_BUS=ata +E:ID_MODEL=TOSHIBA_KSDB4U86 +E:ID_MODEL_ENC=TOSHIBA\x20KSDB4U86 +E:ID_REVISION=0102 +E:ID_SERIAL=TOSHIBA_KSDB4U866TE_DTB0QRJR2EIG +E:ID_SERIAL_SHORT=2160A0D5FVGG +E:ID_ATA_WRITE_CACHE=1 +E:ID_ATA_WRITE_CACHE_ENABLED=0 +E:ID_ATA_FEATURE_SET_PM=1 +E:ID_ATA_FEATURE_SET_PM_ENABLED=1 +E:ID_ATA_FEATURE_SET_SECURITY=1 +E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 +E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=66892 +E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=66892 +E:ID_ATA_FEATURE_SET_SMART=1 +E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 +E:ID_ATA_FEATURE_SET_APM=1 +E:ID_ATA_FEATURE_SET_APM_ENABLED=1 +E:ID_ATA_FEATURE_SET_APM_CURRENT_VALUE=128 +E:ID_ATA_DOWNLOAD_MICROCODE=1 +E:ID_ATA_SATA=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 +E:ID_ATA_ROTATION_RATE_RPM=7200 +E:ID_WWN=0x7c72382b8de36a64 +E:ID_WWN_WITH_EXTENSION=0x7c72382b8de36a64 +E:ID_PATH=pci-0000:3b:00.0-sas-phy7-lun-0 +E:ID_PATH_TAG=pci-0000_3b_00_0-sas-phy7-lun-0 +E:ID_FS_UUID=cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw +E:ID_FS_UUID_ENC=cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw +E:ID_FS_VERSION=LVM2 001 +E:ID_FS_TYPE=LVM2_member +E:ID_FS_USAGE=raid +E:SCSI_TPGS=0 +E:SCSI_TYPE=disk +E:SCSI_VENDOR=ATA +E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_MODEL=TOSHIBA_KSDB4U86 +E:SCSI_MODEL_ENC=TOSHIBA\x20KSDB4U86 +E:SCSI_REVISION=0102 +E:ID_SCSI=1 +E:ID_SCSI_INQUIRY=1 +E:ID_VENDOR=ATA +E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_IDENT_SERIAL=2160A0D5FVGG +E:SCSI_IDENT_LUN_NAA_REG=7c72382b8de36a64 +E:SYSTEMD_READY=1 +E:SYSTEMD_ALIAS=/dev/block/8:0 +E:SYSTEMD_WANTS=lvm2-pvscan@8:0.service +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b8:16 +Lines: 62 +S:disk/by-id/scsi-3e1b87abbb16bd84e +S:disk/by-id/wwn-0xe1b87abbb16bd84e +S:disk/by-path/pci-0000:00:1f.2-ata-1 +S:disk/by-id/scsi-0ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E +S:disk/by-id/scsi-SATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E +S:disk/by-id/scsi-1ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E +S:disk/by-id/ata-SuperMicro_SSD_SMC0E1B87ABBB16BD84E +W:58 +I:147686920 +E:ID_ATA=1 +E:ID_TYPE=disk +E:ID_BUS=ata +E:ID_MODEL=SuperMicro_SSD +E:ID_MODEL_ENC=SuperMicro\x20SSD\x20\x20 +E:ID_REVISION=0R +E:ID_SERIAL=SuperMicro_SSD_SMC0E1B87ABBB16BD84E +E:ID_SERIAL_SHORT=SMC0E1B87ABBB16BD84E +E:ID_ATA_WRITE_CACHE=1 +E:ID_ATA_WRITE_CACHE_ENABLED=1 +E:ID_ATA_FEATURE_SET_HPA=1 +E:ID_ATA_FEATURE_SET_HPA_ENABLED=1 +E:ID_ATA_FEATURE_SET_PM=1 +E:ID_ATA_FEATURE_SET_PM_ENABLED=1 +E:ID_ATA_FEATURE_SET_SECURITY=1 +E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 +E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=4 +E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=4 +E:ID_ATA_FEATURE_SET_SMART=1 +E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 +E:ID_ATA_FEATURE_SET_AAM=1 +E:ID_ATA_FEATURE_SET_AAM_ENABLED=0 +E:ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=0 +E:ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=0 +E:ID_ATA_DOWNLOAD_MICROCODE=1 +E:ID_ATA_SATA=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 +E:ID_ATA_ROTATION_RATE_RPM=0 +E:ID_WWN=0xe1b87abbb16bd84e +E:ID_WWN_WITH_EXTENSION=0xe1b87abbb16bd84e +E:ID_PATH=pci-0000:00:1f.2-ata-1 +E:ID_PATH_TAG=pci-0000_00_1f_2-ata-1 +E:ID_PART_TABLE_UUID=45980145-24e2-4302-a7f0-364c68cfaf59 +E:ID_PART_TABLE_TYPE=gpt +E:SCSI_TPGS=0 +E:SCSI_TYPE=disk +E:SCSI_VENDOR=ATA +E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_MODEL=SuperMicro_SSD +E:SCSI_MODEL_ENC=SuperMicro\x20SSD\x20\x20 +E:SCSI_REVISION=0R +E:ID_SCSI=1 +E:ID_SCSI_INQUIRY=1 +E:ID_VENDOR=ATA +E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_IDENT_SERIAL=SMC0E1B87ABBB16BD84E +E:SCSI_IDENT_LUN_VENDOR=SMC0E1B87ABBB16BD84E +E:SCSI_IDENT_LUN_T10=ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E +E:SCSI_IDENT_LUN_ATA=SuperMicro_SSD_SMC0E1B87ABBB16BD84E +E:SCSI_IDENT_LUN_NAA_REG=e1b87abbb16bd84e +E:ID_FS_TYPE= +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: udev/data/b8:32 +Lines: 62 +S:disk/by-path/pci-0000:00:1f.2-ata-4 +S:disk/by-id/scsi-SATA_INTEL_SSDS9X9SI0_3EWB5Y25CWQWA7EH1U +S:disk/by-id/scsi-0ATA_INTEL_SSDS9X9SI0_3EWB5Y25CWQWA7EH1U +S:disk/by-id/scsi-1ATA_INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U +S:disk/by-id/lvm-pv-uuid-QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb +S:disk/by-id/ata-INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U +S:disk/by-id/scsi-358907ddc573a5de +S:disk/by-id/wwn-0x58907ddc573a5de +W:10 +I:145572852 +E:ID_ATA=1 +E:ID_TYPE=disk +E:ID_BUS=ata +E:ID_MODEL=INTEL_SSDS9X9SI0 +E:ID_MODEL_ENC=INTEL\x20SSDS9X9SI0 +E:ID_REVISION=0100 +E:ID_SERIAL=INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U +E:ID_SERIAL_SHORT=3EWB5Y25CWQWA7EH1U +E:ID_ATA_WRITE_CACHE=1 +E:ID_ATA_WRITE_CACHE_ENABLED=0 +E:ID_ATA_FEATURE_SET_PM=1 +E:ID_ATA_FEATURE_SET_PM_ENABLED=1 +E:ID_ATA_FEATURE_SET_SECURITY=1 +E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 +E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=4 +E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=4 +E:ID_ATA_FEATURE_SET_SMART=1 +E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 +E:ID_ATA_DOWNLOAD_MICROCODE=1 +E:ID_ATA_SATA=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 +E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 +E:ID_ATA_ROTATION_RATE_RPM=0 +E:ID_WWN=0x58907ddc573a5de +E:ID_WWN_WITH_EXTENSION=0x58907ddc573a5de +E:ID_PATH=pci-0000:00:1f.2-ata-4 +E:ID_PATH_TAG=pci-0000_00_1f_2-ata-4 +E:ID_FS_UUID=QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb +E:ID_FS_UUID_ENC=QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb +E:ID_FS_VERSION=LVM2 001 +E:ID_FS_TYPE=LVM2_member +E:ID_FS_USAGE=raid +E:SCSI_TPGS=0 +E:SCSI_TYPE=disk +E:SCSI_VENDOR=ATA +E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_MODEL=INTEL_SSDS9X9SI0 +E:SCSI_MODEL_ENC=INTEL\x20SSDS9X9SI0 +E:SCSI_REVISION=0100 +E:ID_SCSI=1 +E:ID_SCSI_INQUIRY=1 +E:ID_VENDOR=ATA +E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +E:SCSI_IDENT_SERIAL=3EWB5Y25CWQWA7EH1U +E:SCSI_IDENT_LUN_VENDOR=3EWB5Y25CWQWA7EH1U +E:SCSI_IDENT_LUN_T10=ATA_INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U +E:SCSI_IDENT_LUN_ATA=INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U +E:SCSI_IDENT_LUN_NAA_REG=58907ddc573a5de +E:SYSTEMD_READY=1 +E:SYSTEMD_ALIAS=/dev/block/8:32 +E:SYSTEMD_WANTS=lvm2-pvscan@8:32.service +G:systemd +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/collector/fixtures/udev/data/b11:0 b/collector/fixtures/udev/data/b11:0 deleted file mode 100644 index 497620424a..0000000000 --- a/collector/fixtures/udev/data/b11:0 +++ /dev/null @@ -1,38 +0,0 @@ -S:disk/by-id/usb-AMI_Virtual_CDROM0_AAAABBBBCCCC1-0:0 -S:disk/by-path/pci-0000:00:14.0-usb-0:1.1:1.0-scsi-0:0:0:0 -S:cdrom -L:-100 -I:83543243 -E:ID_CDROM=1 -E:SYSTEMD_MOUNT_DEVICE_BOUND=1 -E:ID_VENDOR=AMI -E:ID_VENDOR_ENC=AMI\x20\x20\x20\x20\x20 -E:ID_VENDOR_ID=c096 -E:ID_MODEL=Virtual_CDROM0 -E:ID_MODEL_ENC=Virtual\x20CDROM0\x20\x20 -E:ID_MODEL_ID=ee31 -E:ID_REVISION=1.00 -E:ID_SERIAL=AMI_Virtual_CDROM0_AAAABBBBCCCC1-0:0 -E:ID_SERIAL_SHORT=AAAABBBBCCCC1 -E:ID_TYPE=cd/dvd -E:ID_INSTANCE=0:0 -E:ID_BUS=usb -E:ID_USB_INTERFACES=:905639: -E:ID_USB_INTERFACE_NUM=00 -E:ID_USB_DRIVER=usb-storage -E:ID_PATH=pci-0000:00:14.0-usb-0:1.1:1.0-scsi-0:0:0:0 -E:ID_PATH_TAG=pci-0000_00_14_0-usb-0_1_1_1_0-scsi-0_0_0_0 -E:SCSI_TPGS=0 -E:SCSI_TYPE=cd/dvd -E:SCSI_VENDOR=AMI -E:SCSI_VENDOR_ENC=AMI\x20\x20\x20\x20\x20 -E:SCSI_MODEL=Virtual_CDROM0 -E:SCSI_MODEL_ENC=Virtual\x20CDROM0\x20\x20 -E:SCSI_REVISION=1.00 -E:ID_SCSI=1 -E:ID_SCSI_INQUIRY=1 -E:ID_FS_TYPE= -E:ID_FOR_SEAT=block-pci-0000_00_14_0-usb-0_1_1_1_0-scsi-0_0_0_0 -G:uaccess -G:systemd -G:seat diff --git a/collector/fixtures/udev/data/b179:0 b/collector/fixtures/udev/data/b179:0 deleted file mode 100644 index 99966ad3eb..0000000000 --- a/collector/fixtures/udev/data/b179:0 +++ /dev/null @@ -1,13 +0,0 @@ -S:disk/by-path/platform-df2969f3.mmc -S:disk/by-id/mmc-SC64G_0x83e36d93 -W:1 -I:7679747 -E:ID_NAME=SC64G -E:ID_SERIAL=0x83e36d93 -E:ID_PATH=platform-df2969f3.mmc -E:ID_PATH_TAG=platform-df2969f3_mmc -E:ID_PART_TABLE_UUID=1954c9df -E:ID_PART_TABLE_TYPE=dos -E:ID_DRIVE_FLASH_SD=1 -E:ID_DRIVE_MEDIA_FLASH_SD=1 -G:systemd diff --git a/collector/fixtures/udev/data/b179:1 b/collector/fixtures/udev/data/b179:1 deleted file mode 100644 index c70ea1cab6..0000000000 --- a/collector/fixtures/udev/data/b179:1 +++ /dev/null @@ -1,30 +0,0 @@ -S:disk/by-id/mmc-SC64G_0x83e36d93-part1 -S:disk/by-path/platform-df2969f3.mmc-part1 -S:disk/by-label/boot -S:disk/by-uuid/6284-658D -S:disk/by-partuuid/1954c9df-01 -W:12 -I:8463403 -E:ID_NAME=SC64G -E:ID_SERIAL=0x83e36d93 -E:ID_PATH=platform-df2969f3.mmc -E:ID_PATH_TAG=platform-df2969f3_mmc -E:ID_PART_TABLE_UUID=1954c9df -E:ID_PART_TABLE_TYPE=dos -E:ID_DRIVE_FLASH_SD=1 -E:ID_DRIVE_MEDIA_FLASH_SD=1 -E:ID_FS_LABEL=boot -E:ID_FS_LABEL_ENC=boot -E:ID_FS_UUID=6284-658D -E:ID_FS_UUID_ENC=6284-658D -E:ID_FS_VERSION=FAT32 -E:ID_FS_TYPE=vfat -E:ID_FS_USAGE=filesystem -E:ID_PART_ENTRY_SCHEME=dos -E:ID_PART_ENTRY_UUID=1954c9df-01 -E:ID_PART_ENTRY_TYPE=0xc -E:ID_PART_ENTRY_NUMBER=1 -E:ID_PART_ENTRY_OFFSET=8192 -E:ID_PART_ENTRY_SIZE=524288 -E:ID_PART_ENTRY_DISK=179:0 -G:systemd diff --git a/collector/fixtures/udev/data/b179:2 b/collector/fixtures/udev/data/b179:2 deleted file mode 100644 index 9acdd60570..0000000000 --- a/collector/fixtures/udev/data/b179:2 +++ /dev/null @@ -1,30 +0,0 @@ -S:disk/by-id/mmc-SC64G_0x83e36d93-part2 -S:disk/by-path/platform-df2969f3.mmc-part2 -S:disk/by-label/rootfs -S:disk/by-uuid/83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 -S:disk/by-partuuid/1954c9df-02 -W:2 -I:7676649 -E:ID_NAME=SC64G -E:ID_SERIAL=0x83e36d93 -E:ID_PATH=platform-df2969f3.mmc -E:ID_PATH_TAG=platform-df2969f3_mmc -E:ID_PART_TABLE_UUID=1954c9df -E:ID_PART_TABLE_TYPE=dos -E:ID_DRIVE_FLASH_SD=1 -E:ID_DRIVE_MEDIA_FLASH_SD=1 -E:ID_FS_LABEL=rootfs -E:ID_FS_LABEL_ENC=rootfs -E:ID_FS_UUID=83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 -E:ID_FS_UUID_ENC=83324ce8-a6f3-4e35-ad64-dbb3d6b87a32 -E:ID_FS_VERSION=1.0 -E:ID_FS_TYPE=ext4 -E:ID_FS_USAGE=filesystem -E:ID_PART_ENTRY_SCHEME=dos -E:ID_PART_ENTRY_UUID=1954c9df-02 -E:ID_PART_ENTRY_TYPE=0x83 -E:ID_PART_ENTRY_NUMBER=2 -E:ID_PART_ENTRY_OFFSET=532480 -E:ID_PART_ENTRY_SIZE=124203008 -E:ID_PART_ENTRY_DISK=179:0 -G:systemd diff --git a/collector/fixtures/udev/data/b252:0 b/collector/fixtures/udev/data/b252:0 deleted file mode 100644 index 65e16538c0..0000000000 --- a/collector/fixtures/udev/data/b252:0 +++ /dev/null @@ -1,20 +0,0 @@ -S:disk/by-id/dm-name-nvme0n1_crypt -S:mapper/nvme0n1_crypt -S:disk/by-id/lvm-pv-uuid-c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB -S:disk/by-id/dm-uuid-CRYPT-LUKS2-jolaulot80fy9zsiobkxyxo7y2dqeho2-nvme0n1_crypt -I:72859885 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=nvme0n1_crypt -E:DM_UUID=CRYPT-LUKS2-jolaulot80fy9zsiobkxyxo7y2dqeho2-nvme0n1_crypt -E:DM_SUSPENDED=0 -E:ID_FS_UUID=c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB -E:ID_FS_UUID_ENC=c3C3uW-gD96-Yw69-c1CJ-5MwT-6ysM-mST0vB -E:ID_FS_VERSION=LVM2 001 -E:ID_FS_TYPE=LVM2_member -E:ID_FS_USAGE=raid -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b252:1 b/collector/fixtures/udev/data/b252:1 deleted file mode 100644 index 1200ed6ebf..0000000000 --- a/collector/fixtures/udev/data/b252:1 +++ /dev/null @@ -1,24 +0,0 @@ -S:disk/by-id/dm-uuid-LVM-wbGqQEBL9SxrW2DLntJwgg8fAv946hw3Tvjqh0v31fWgxEtD4BoHO0lROWFUY65T -S:mapper/system-swap_1 -S:disk/by-id/dm-name-system-swap_1 -S:disk/by-uuid/5272bb60-04b5-49cd-b730-be57c7604450 -S:system/swap_1 -I:78705530 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=system-swap_1 -E:DM_UUID=LVM-wbGqQEBL9SxrW2DLntJwgg8fAv946hw3Tvjqh0v31fWgxEtD4BoHO0lROWFUY65T -E:DM_SUSPENDED=0 -E:DM_VG_NAME=system -E:DM_LV_NAME=swap_1 -E:DM_LV_LAYER= -E:ID_FS_UUID=5272bb60-04b5-49cd-b730-be57c7604450 -E:ID_FS_UUID_ENC=5272bb60-04b5-49cd-b730-be57c7604450 -E:ID_FS_VERSION=1 -E:ID_FS_TYPE=swap -E:ID_FS_USAGE=other -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b252:2 b/collector/fixtures/udev/data/b252:2 deleted file mode 100644 index 76aa838ac1..0000000000 --- a/collector/fixtures/udev/data/b252:2 +++ /dev/null @@ -1,24 +0,0 @@ -S:disk/by-id/dm-name-system-root -S:disk/by-id/dm-uuid-LVM-NWEDo8q5ABDyJuC3F8veKNyWfYmeIBfFMS4MF3HakzUhkk7ekDm6fJTHkl2fYHe7 -S:mapper/system-root -S:disk/by-uuid/3deafd0d-faff-4695-8d15-51061ae1f51b -S:system/root -I:77655410 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=system-root -E:DM_UUID=LVM-NWEDo8q5ABDyJuC3F8veKNyWfYmeIBfFMS4MF3HakzUhkk7ekDm6fJTHkl2fYHe7 -E:DM_SUSPENDED=0 -E:DM_VG_NAME=system -E:DM_LV_NAME=root -E:DM_LV_LAYER= -E:ID_FS_UUID=3deafd0d-faff-4695-8d15-51061ae1f51b -E:ID_FS_UUID_ENC=3deafd0d-faff-4695-8d15-51061ae1f51b -E:ID_FS_VERSION=1.0 -E:ID_FS_TYPE=ext4 -E:ID_FS_USAGE=filesystem -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b252:3 b/collector/fixtures/udev/data/b252:3 deleted file mode 100644 index 6ec045a156..0000000000 --- a/collector/fixtures/udev/data/b252:3 +++ /dev/null @@ -1,24 +0,0 @@ -S:disk/by-id/dm-name-system-var -S:disk/by-id/dm-uuid-LVM-hrxHo0rlZ6U95ku5841Lpd17bS1Z7V7lrtEE60DVgE6YEOCdS9gcDGyonWim4hGP -S:mapper/system-var -S:disk/by-uuid/5c772222-f7d4-4c8e-87e8-e97df6b7a45e -S:system/var -I:79395348 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=system-var -E:DM_UUID=LVM-hrxHo0rlZ6U95ku5841Lpd17bS1Z7V7lrtEE60DVgE6YEOCdS9gcDGyonWim4hGP -E:DM_SUSPENDED=0 -E:DM_VG_NAME=system -E:DM_LV_NAME=var -E:DM_LV_LAYER= -E:ID_FS_UUID=5c772222-f7d4-4c8e-87e8-e97df6b7a45e -E:ID_FS_UUID_ENC=5c772222-f7d4-4c8e-87e8-e97df6b7a45e -E:ID_FS_VERSION=1.0 -E:ID_FS_TYPE=ext4 -E:ID_FS_USAGE=filesystem -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b252:4 b/collector/fixtures/udev/data/b252:4 deleted file mode 100644 index 8e12f33b1b..0000000000 --- a/collector/fixtures/udev/data/b252:4 +++ /dev/null @@ -1,24 +0,0 @@ -S:system/tmp -S:disk/by-uuid/a9479d44-60e1-4015-a1e5-bb065e6dd11b -S:disk/by-id/dm-uuid-LVM-XTNGOHjPWLHcxmJmVu5cWTXEtuzqDeBkdEHAZW5q9LxWQ2d4mb5CchUQzUPJpl8H -S:mapper/system-tmp -S:disk/by-id/dm-name-system-tmp -I:75852450 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=system-tmp -E:DM_UUID=LVM-XTNGOHjPWLHcxmJmVu5cWTXEtuzqDeBkdEHAZW5q9LxWQ2d4mb5CchUQzUPJpl8H -E:DM_SUSPENDED=0 -E:DM_VG_NAME=system -E:DM_LV_NAME=tmp -E:DM_LV_LAYER= -E:ID_FS_UUID=a9479d44-60e1-4015-a1e5-bb065e6dd11b -E:ID_FS_UUID_ENC=a9479d44-60e1-4015-a1e5-bb065e6dd11b -E:ID_FS_VERSION=1.0 -E:ID_FS_TYPE=ext4 -E:ID_FS_USAGE=filesystem -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b252:5 b/collector/fixtures/udev/data/b252:5 deleted file mode 100644 index 3cda72ea8d..0000000000 --- a/collector/fixtures/udev/data/b252:5 +++ /dev/null @@ -1,24 +0,0 @@ -S:disk/by-uuid/b05b726a-c718-4c4d-8641-7c73a7696d83 -S:mapper/system-home -S:system/home -S:disk/by-id/dm-name-system-home -S:disk/by-id/dm-uuid-LVM-MtoJaWTpjWRXlUnNFlpxZauTEuYlMvGFutigEzCCrfj8CNh6jCRi5LQJXZCpLjPf -I:72604009 -E:DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 -E:DM_UDEV_PRIMARY_SOURCE_FLAG=1 -E:DM_UDEV_RULES=1 -E:DM_UDEV_RULES_VSN=2 -E:DM_NAME=system-home -E:DM_UUID=LVM-MtoJaWTpjWRXlUnNFlpxZauTEuYlMvGFutigEzCCrfj8CNh6jCRi5LQJXZCpLjPf -E:DM_SUSPENDED=0 -E:DM_VG_NAME=system -E:DM_LV_NAME=home -E:DM_LV_LAYER= -E:ID_FS_UUID=b05b726a-c718-4c4d-8641-7c73a7696d83 -E:ID_FS_UUID_ENC=b05b726a-c718-4c4d-8641-7c73a7696d83 -E:ID_FS_VERSION=1.0 -E:ID_FS_TYPE=ext4 -E:ID_FS_USAGE=filesystem -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b254:0 b/collector/fixtures/udev/data/b254:0 deleted file mode 100644 index 20f7c2ab9d..0000000000 --- a/collector/fixtures/udev/data/b254:0 +++ /dev/null @@ -1,10 +0,0 @@ -S:disk/by-path/pci-0000:00:06.0 -S:disk/by-path/virtio-pci-0000:00:06.0 -W:1 -I:8524171 -E:ID_PATH=pci-0000:00:06.0 -E:ID_PATH_TAG=pci-0000_00_06_0 -E:ID_PART_TABLE_UUID=653b59fd -E:ID_PART_TABLE_TYPE=dos -E:ID_FS_TYPE= -G:systemd diff --git a/collector/fixtures/udev/data/b259:0 b/collector/fixtures/udev/data/b259:0 deleted file mode 100644 index 1f51f5bb05..0000000000 --- a/collector/fixtures/udev/data/b259:0 +++ /dev/null @@ -1,17 +0,0 @@ -S:disk/by-path/pci-0000:02:00.0-nvme-1 -S:disk/by-id/nvme-eui.p3vbbiejx5aae2r3 -S:disk/by-id/nvme-SAMSUNG_EHFTF55LURSY-000Y9_S252B6CU1HG3M1 -I:79621327 -E:ID_SERIAL_SHORT=S252B6CU1HG3M1 -E:ID_WWN=eui.p3vbbiejx5aae2r3 -E:ID_MODEL=SAMSUNG EHFTF55LURSY-000Y9 -E:ID_REVISION=4NBTUY95 -E:ID_SERIAL=SAMSUNG_EHFTF55LURSY-000Y9_S252B6CU1HG3M1 -E:ID_PATH=pci-0000:02:00.0-nvme-1 -E:ID_PATH_TAG=pci-0000_02_00_0-nvme-1 -E:ID_PART_TABLE_UUID=f301fdbd-fd1f-46d4-9fb8-c9aeb757f050 -E:ID_PART_TABLE_TYPE=gpt -E:ID_FS_TYPE= -G:systemd -Q:systemd -V:1 diff --git a/collector/fixtures/udev/data/b8:0 b/collector/fixtures/udev/data/b8:0 deleted file mode 100644 index 7462e22fd1..0000000000 --- a/collector/fixtures/udev/data/b8:0 +++ /dev/null @@ -1,60 +0,0 @@ -S:disk/by-id/lvm-pv-uuid-cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw -S:disk/by-id/scsi-SATA_TOSHIBA_KSDB4U86_2160A0D5FVGG -S:disk/by-id/ata-TOSHIBA_KSDB4U866TE_2160A0D5FVGG -S:disk/by-path/pci-0000:3b:00.0-sas-phy7-lun-0 -S:disk/by-id/scsi-37c72382b8de36a64 -S:disk/by-id/wwn-0x7c72382b8de36a64 -W:702 -I:73815117 -E:ID_ATA=1 -E:ID_TYPE=disk -E:ID_BUS=ata -E:ID_MODEL=TOSHIBA_KSDB4U86 -E:ID_MODEL_ENC=TOSHIBA\x20KSDB4U86 -E:ID_REVISION=0102 -E:ID_SERIAL=TOSHIBA_KSDB4U866TE_DTB0QRJR2EIG -E:ID_SERIAL_SHORT=2160A0D5FVGG -E:ID_ATA_WRITE_CACHE=1 -E:ID_ATA_WRITE_CACHE_ENABLED=0 -E:ID_ATA_FEATURE_SET_PM=1 -E:ID_ATA_FEATURE_SET_PM_ENABLED=1 -E:ID_ATA_FEATURE_SET_SECURITY=1 -E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 -E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=66892 -E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=66892 -E:ID_ATA_FEATURE_SET_SMART=1 -E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 -E:ID_ATA_FEATURE_SET_APM=1 -E:ID_ATA_FEATURE_SET_APM_ENABLED=1 -E:ID_ATA_FEATURE_SET_APM_CURRENT_VALUE=128 -E:ID_ATA_DOWNLOAD_MICROCODE=1 -E:ID_ATA_SATA=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 -E:ID_ATA_ROTATION_RATE_RPM=7200 -E:ID_WWN=0x7c72382b8de36a64 -E:ID_WWN_WITH_EXTENSION=0x7c72382b8de36a64 -E:ID_PATH=pci-0000:3b:00.0-sas-phy7-lun-0 -E:ID_PATH_TAG=pci-0000_3b_00_0-sas-phy7-lun-0 -E:ID_FS_UUID=cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw -E:ID_FS_UUID_ENC=cVVv6j-HSA2-IY33-1Jmj-dO2H-YL7w-b4Oxqw -E:ID_FS_VERSION=LVM2 001 -E:ID_FS_TYPE=LVM2_member -E:ID_FS_USAGE=raid -E:SCSI_TPGS=0 -E:SCSI_TYPE=disk -E:SCSI_VENDOR=ATA -E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_MODEL=TOSHIBA_KSDB4U86 -E:SCSI_MODEL_ENC=TOSHIBA\x20KSDB4U86 -E:SCSI_REVISION=0102 -E:ID_SCSI=1 -E:ID_SCSI_INQUIRY=1 -E:ID_VENDOR=ATA -E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_IDENT_SERIAL=2160A0D5FVGG -E:SCSI_IDENT_LUN_NAA_REG=7c72382b8de36a64 -E:SYSTEMD_READY=1 -E:SYSTEMD_ALIAS=/dev/block/8:0 -E:SYSTEMD_WANTS=lvm2-pvscan@8:0.service -G:systemd diff --git a/collector/fixtures/udev/data/b8:16 b/collector/fixtures/udev/data/b8:16 deleted file mode 100644 index 7ca57ff32c..0000000000 --- a/collector/fixtures/udev/data/b8:16 +++ /dev/null @@ -1,62 +0,0 @@ -S:disk/by-id/scsi-3e1b87abbb16bd84e -S:disk/by-id/wwn-0xe1b87abbb16bd84e -S:disk/by-path/pci-0000:00:1f.2-ata-1 -S:disk/by-id/scsi-0ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E -S:disk/by-id/scsi-SATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E -S:disk/by-id/scsi-1ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E -S:disk/by-id/ata-SuperMicro_SSD_SMC0E1B87ABBB16BD84E -W:58 -I:147686920 -E:ID_ATA=1 -E:ID_TYPE=disk -E:ID_BUS=ata -E:ID_MODEL=SuperMicro_SSD -E:ID_MODEL_ENC=SuperMicro\x20SSD\x20\x20 -E:ID_REVISION=0R -E:ID_SERIAL=SuperMicro_SSD_SMC0E1B87ABBB16BD84E -E:ID_SERIAL_SHORT=SMC0E1B87ABBB16BD84E -E:ID_ATA_WRITE_CACHE=1 -E:ID_ATA_WRITE_CACHE_ENABLED=1 -E:ID_ATA_FEATURE_SET_HPA=1 -E:ID_ATA_FEATURE_SET_HPA_ENABLED=1 -E:ID_ATA_FEATURE_SET_PM=1 -E:ID_ATA_FEATURE_SET_PM_ENABLED=1 -E:ID_ATA_FEATURE_SET_SECURITY=1 -E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 -E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=4 -E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=4 -E:ID_ATA_FEATURE_SET_SMART=1 -E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 -E:ID_ATA_FEATURE_SET_AAM=1 -E:ID_ATA_FEATURE_SET_AAM_ENABLED=0 -E:ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=0 -E:ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=0 -E:ID_ATA_DOWNLOAD_MICROCODE=1 -E:ID_ATA_SATA=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 -E:ID_ATA_ROTATION_RATE_RPM=0 -E:ID_WWN=0xe1b87abbb16bd84e -E:ID_WWN_WITH_EXTENSION=0xe1b87abbb16bd84e -E:ID_PATH=pci-0000:00:1f.2-ata-1 -E:ID_PATH_TAG=pci-0000_00_1f_2-ata-1 -E:ID_PART_TABLE_UUID=45980145-24e2-4302-a7f0-364c68cfaf59 -E:ID_PART_TABLE_TYPE=gpt -E:SCSI_TPGS=0 -E:SCSI_TYPE=disk -E:SCSI_VENDOR=ATA -E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_MODEL=SuperMicro_SSD -E:SCSI_MODEL_ENC=SuperMicro\x20SSD\x20\x20 -E:SCSI_REVISION=0R -E:ID_SCSI=1 -E:ID_SCSI_INQUIRY=1 -E:ID_VENDOR=ATA -E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_IDENT_SERIAL=SMC0E1B87ABBB16BD84E -E:SCSI_IDENT_LUN_VENDOR=SMC0E1B87ABBB16BD84E -E:SCSI_IDENT_LUN_T10=ATA_SuperMicro_SSD_SMC0E1B87ABBB16BD84E -E:SCSI_IDENT_LUN_ATA=SuperMicro_SSD_SMC0E1B87ABBB16BD84E -E:SCSI_IDENT_LUN_NAA_REG=e1b87abbb16bd84e -E:ID_FS_TYPE= -G:systemd diff --git a/collector/fixtures/udev/data/b8:32 b/collector/fixtures/udev/data/b8:32 deleted file mode 100644 index 881f9f0237..0000000000 --- a/collector/fixtures/udev/data/b8:32 +++ /dev/null @@ -1,62 +0,0 @@ -S:disk/by-path/pci-0000:00:1f.2-ata-4 -S:disk/by-id/scsi-SATA_INTEL_SSDS9X9SI0_3EWB5Y25CWQWA7EH1U -S:disk/by-id/scsi-0ATA_INTEL_SSDS9X9SI0_3EWB5Y25CWQWA7EH1U -S:disk/by-id/scsi-1ATA_INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U -S:disk/by-id/lvm-pv-uuid-QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb -S:disk/by-id/ata-INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U -S:disk/by-id/scsi-358907ddc573a5de -S:disk/by-id/wwn-0x58907ddc573a5de -W:10 -I:145572852 -E:ID_ATA=1 -E:ID_TYPE=disk -E:ID_BUS=ata -E:ID_MODEL=INTEL_SSDS9X9SI0 -E:ID_MODEL_ENC=INTEL\x20SSDS9X9SI0 -E:ID_REVISION=0100 -E:ID_SERIAL=INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U -E:ID_SERIAL_SHORT=3EWB5Y25CWQWA7EH1U -E:ID_ATA_WRITE_CACHE=1 -E:ID_ATA_WRITE_CACHE_ENABLED=0 -E:ID_ATA_FEATURE_SET_PM=1 -E:ID_ATA_FEATURE_SET_PM_ENABLED=1 -E:ID_ATA_FEATURE_SET_SECURITY=1 -E:ID_ATA_FEATURE_SET_SECURITY_ENABLED=0 -E:ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=4 -E:ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=4 -E:ID_ATA_FEATURE_SET_SMART=1 -E:ID_ATA_FEATURE_SET_SMART_ENABLED=1 -E:ID_ATA_DOWNLOAD_MICROCODE=1 -E:ID_ATA_SATA=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN2=1 -E:ID_ATA_SATA_SIGNAL_RATE_GEN1=1 -E:ID_ATA_ROTATION_RATE_RPM=0 -E:ID_WWN=0x58907ddc573a5de -E:ID_WWN_WITH_EXTENSION=0x58907ddc573a5de -E:ID_PATH=pci-0000:00:1f.2-ata-4 -E:ID_PATH_TAG=pci-0000_00_1f_2-ata-4 -E:ID_FS_UUID=QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb -E:ID_FS_UUID_ENC=QFy9W7-Brj3-hQ6v-AF8i-3Zqg-n3Vs-kGY4vb -E:ID_FS_VERSION=LVM2 001 -E:ID_FS_TYPE=LVM2_member -E:ID_FS_USAGE=raid -E:SCSI_TPGS=0 -E:SCSI_TYPE=disk -E:SCSI_VENDOR=ATA -E:SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_MODEL=INTEL_SSDS9X9SI0 -E:SCSI_MODEL_ENC=INTEL\x20SSDS9X9SI0 -E:SCSI_REVISION=0100 -E:ID_SCSI=1 -E:ID_SCSI_INQUIRY=1 -E:ID_VENDOR=ATA -E:ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 -E:SCSI_IDENT_SERIAL=3EWB5Y25CWQWA7EH1U -E:SCSI_IDENT_LUN_VENDOR=3EWB5Y25CWQWA7EH1U -E:SCSI_IDENT_LUN_T10=ATA_INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U -E:SCSI_IDENT_LUN_ATA=INTEL_SSDS9X9SI00G8_3EWB5Y25CWQWA7EH1U -E:SCSI_IDENT_LUN_NAA_REG=58907ddc573a5de -E:SYSTEMD_READY=1 -E:SYSTEMD_ALIAS=/dev/block/8:32 -E:SYSTEMD_WANTS=lvm2-pvscan@8:32.service -G:systemd diff --git a/collector/hwmon_linux.go b/collector/hwmon_linux.go index 621f7c93ff..a8086d309e 100644 --- a/collector/hwmon_linux.go +++ b/collector/hwmon_linux.go @@ -24,6 +24,7 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" @@ -31,6 +32,9 @@ import ( ) var ( + collectorHWmonChipInclude = kingpin.Flag("collector.hwmon.chip-include", "Regexp of hwmon chip to include (mutually exclusive to device-exclude).").String() + collectorHWmonChipExclude = kingpin.Flag("collector.hwmon.chip-exclude", "Regexp of hwmon chip to exclude (mutually exclusive to device-include).").String() + hwmonInvalidMetricChars = regexp.MustCompile("[^a-z0-9:_]") hwmonFilenameFormat = regexp.MustCompile(`^(?P[^0-9]+)(?P[0-9]*)?(_(?P.+))?$`) hwmonLabelDesc = []string{"chip", "sensor"} @@ -47,13 +51,18 @@ func init() { } type hwMonCollector struct { - logger log.Logger + deviceFilter deviceFilter + logger log.Logger } // NewHwMonCollector returns a new Collector exposing /sys/class/hwmon stats // (similar to lm-sensors). func NewHwMonCollector(logger log.Logger) (Collector, error) { - return &hwMonCollector{logger}, nil + + return &hwMonCollector{ + logger: logger, + deviceFilter: newDeviceFilter(*collectorHWmonChipExclude, *collectorHWmonChipInclude), + }, nil } func cleanMetricName(name string) string { @@ -154,6 +163,11 @@ func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) er return err } + if c.deviceFilter.ignored(hwmonName) { + level.Debug(c.logger).Log("msg", "ignoring hwmon chip", "chip", hwmonName) + return nil + } + data := make(map[string]map[string]string) err = collectSensorData(dir, data) if err != nil { @@ -192,12 +206,10 @@ func (c *hwMonCollector) updateHwmon(ch chan<- prometheus.Metric, dir string) er labels := []string{hwmonName, sensor} if labelText, ok := sensorData["label"]; ok { - label := cleanMetricName(labelText) - if label != "" { - desc := prometheus.NewDesc("node_hwmon_sensor_label", "Label for given chip and sensor", - []string{"chip", "sensor", "label"}, nil) - ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, 1.0, hwmonName, sensor, label) - } + label := strings.ToValidUTF8(labelText, "�") + desc := prometheus.NewDesc("node_hwmon_sensor_label", "Label for given chip and sensor", + []string{"chip", "sensor", "label"}, nil) + ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, 1.0, hwmonName, sensor, label) } if sensorType == "beep_enable" { @@ -432,9 +444,13 @@ func (c *hwMonCollector) Update(ch chan<- prometheus.Metric) error { return err } + var lastErr error for _, hwDir := range hwmonFiles { hwmonXPathName := filepath.Join(hwmonPathName, hwDir.Name()) - fileInfo, _ := os.Lstat(hwmonXPathName) + fileInfo, err := os.Lstat(hwmonXPathName) + if err != nil { + continue + } if fileInfo.Mode()&os.ModeSymlink > 0 { fileInfo, err = os.Stat(hwmonXPathName) @@ -447,10 +463,10 @@ func (c *hwMonCollector) Update(ch chan<- prometheus.Metric) error { continue } - if lastErr := c.updateHwmon(ch, hwmonXPathName); lastErr != nil { - err = lastErr + if err = c.updateHwmon(ch, hwmonXPathName); err != nil { + lastErr = err } } - return err + return lastErr } diff --git a/collector/infiniband_linux.go b/collector/infiniband_linux.go index 3afb7c45b6..b0928da3cf 100644 --- a/collector/infiniband_linux.go +++ b/collector/infiniband_linux.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !noinfiniband -// +build linux,!noinfiniband +//go:build !noinfiniband +// +build !noinfiniband package collector diff --git a/collector/interrupts_linux.go b/collector/interrupts_linux.go index 4d74c536a6..ede7819111 100644 --- a/collector/interrupts_linux.go +++ b/collector/interrupts_linux.go @@ -77,22 +77,29 @@ func parseInterrupts(r io.Reader) (map[string]interrupt, error) { cpuNum := len(strings.Fields(scanner.Text())) // one header per cpu for scanner.Scan() { - parts := strings.Fields(scanner.Text()) - if len(parts) < cpuNum+2 { // irq + one column per cpu + details, - continue // we ignore ERR and MIS for now - } - intName := parts[0][:len(parts[0])-1] // remove trailing : - intr := interrupt{ - values: parts[1 : cpuNum+1], - } + // On aarch64 there can be zero space between the name/label + // and the values, so we need to split on `:` before using + // strings.Fields() to split on fields. + group := strings.SplitN(scanner.Text(), ":", 2) + if len(group) > 1 { + parts := strings.Fields(group[1]) + + if len(parts) < cpuNum+1 { // irq + one column per cpu + details, + continue // we ignore ERR and MIS for now + } + intName := strings.TrimLeft(group[0], " ") + intr := interrupt{ + values: parts[0:cpuNum], + } - if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt - intr.info = parts[cpuNum+1] - intr.devices = strings.Join(parts[cpuNum+2:], " ") - } else { - intr.info = strings.Join(parts[cpuNum+1:], " ") + if _, err := strconv.Atoi(intName); err == nil { // numeral interrupt + intr.info = parts[cpuNum] + intr.devices = strings.Join(parts[cpuNum+1:], " ") + } else { + intr.info = strings.Join(parts[cpuNum:], " ") + } + interrupts[intName] = intr } - interrupts[intName] = intr } return interrupts, scanner.Err() diff --git a/collector/interrupts_linux_test.go b/collector/interrupts_linux_test.go index 02acb896a0..82e536e4e9 100644 --- a/collector/interrupts_linux_test.go +++ b/collector/interrupts_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nointerrupts +// +build !nointerrupts + package collector import ( @@ -31,10 +34,39 @@ func TestInterrupts(t *testing.T) { } if want, got := "5031", interrupts["NMI"].values[1]; want != got { - t.Errorf("want interrupts %s, got %s", want, got) + t.Errorf("want interrupts value %s, got %s", want, got) } if want, got := "4968", interrupts["NMI"].values[3]; want != got { - t.Errorf("want interrupts %s, got %s", want, got) + t.Errorf("want interrupts value %s, got %s", want, got) + } + + if want, got := "IR-IO-APIC-edge", interrupts["12"].info; want != got { + t.Errorf("want interrupts info %s, got %s", want, got) + } + + if want, got := "i8042", interrupts["12"].devices; want != got { + t.Errorf("want interrupts devices %s, got %s", want, got) + } + +} + +// https://github.com/prometheus/node_exporter/issues/2557 +// On aarch64 the interrupts file can have zero spaces between the label of +// the row and the first value if the value is large +func TestInterruptsArm(t *testing.T) { + file, err := os.Open("fixtures/proc/interrupts_aarch64") + if err != nil { + t.Fatal(err) + } + defer file.Close() + + interrupts, err := parseInterrupts(file) + if err != nil { + t.Fatal(err) + } + + if _, ok := interrupts["IPI0"]; !ok { + t.Errorf("IPI0 label not found in interrupts") } } diff --git a/collector/interrupts_openbsd.go b/collector/interrupts_openbsd.go index ba73406954..9fa5b68d5d 100644 --- a/collector/interrupts_openbsd.go +++ b/collector/interrupts_openbsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build openbsd && !amd64 && !nointerrupts -// +build openbsd,!amd64,!nointerrupts +//go:build !nointerrupts && !amd64 +// +build !nointerrupts,!amd64 package collector diff --git a/collector/ipvs_linux.go b/collector/ipvs_linux.go index 4a9c14b6d3..63a3a1a8a8 100644 --- a/collector/ipvs_linux.go +++ b/collector/ipvs_linux.go @@ -24,11 +24,11 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) type ipvsCollector struct { diff --git a/collector/ipvs_linux_test.go b/collector/ipvs_linux_test.go index fb62a930ae..6ee41b299b 100644 --- a/collector/ipvs_linux_test.go +++ b/collector/ipvs_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !noipvs +// +build !noipvs + package collector import ( @@ -24,9 +27,9 @@ import ( "github.com/go-kit/log" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - "gopkg.in/alecthomas/kingpin.v2" ) func TestIPVSCollector(t *testing.T) { @@ -209,9 +212,8 @@ func TestIPVSCollectorResponse(t *testing.T) { if want == got { // this is a line we are interested in, and it is correct continue wantLoop - } else { - gotLinesIdx++ } + gotLinesIdx++ } // if this point is reached, the line we want was missing t.Fatalf("Missing expected output line(s), first missing line is %s", want) diff --git a/collector/loadavg_linux_test.go b/collector/loadavg_linux_test.go index e8e5a0ce3f..2d56317dc5 100644 --- a/collector/loadavg_linux_test.go +++ b/collector/loadavg_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !noloadavg +// +build !noloadavg + package collector import "testing" diff --git a/collector/logind_linux_test.go b/collector/logind_linux_test.go index e8d9cb02f1..5cfedff4db 100644 --- a/collector/logind_linux_test.go +++ b/collector/logind_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nologind +// +build !nologind + package collector import ( diff --git a/collector/meminfo.go b/collector/meminfo.go index 8437f0f172..b59337ddbd 100644 --- a/collector/meminfo.go +++ b/collector/meminfo.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build (darwin || linux || openbsd) && !nomeminfo -// +build darwin linux openbsd +//go:build (darwin || linux || openbsd || netbsd) && !nomeminfo +// +build darwin linux openbsd netbsd // +build !nomeminfo package collector diff --git a/collector/meminfo_linux_test.go b/collector/meminfo_linux_test.go index dc0aff58d7..a000bea53c 100644 --- a/collector/meminfo_linux_test.go +++ b/collector/meminfo_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nomeminfo +// +build !nomeminfo + package collector import ( diff --git a/collector/meminfo_netbsd.go b/collector/meminfo_netbsd.go new file mode 100644 index 0000000000..a1bd118523 --- /dev/null +++ b/collector/meminfo_netbsd.go @@ -0,0 +1,43 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nomeminfo +// +build !nomeminfo + +package collector + +import ( + "golang.org/x/sys/unix" +) + +func (c *meminfoCollector) getMemInfo() (map[string]float64, error) { + uvmexp, err := unix.SysctlUvmexp("vm.uvmexp2") + if err != nil { + return nil, err + } + + ps := float64(uvmexp.Pagesize) + + // see uvm(9) + return map[string]float64{ + "active_bytes": ps * float64(uvmexp.Active), + "free_bytes": ps * float64(uvmexp.Free), + "inactive_bytes": ps * float64(uvmexp.Inactive), + "size_bytes": ps * float64(uvmexp.Npages), + "swap_size_bytes": ps * float64(uvmexp.Swpages), + "swap_used_bytes": ps * float64(uvmexp.Swpginuse), + "swapped_in_pages_bytes_total": ps * float64(uvmexp.Pgswapin), + "swapped_out_pages_bytes_total": ps * float64(uvmexp.Pgswapout), + "wired_bytes": ps * float64(uvmexp.Wired), + }, nil +} diff --git a/collector/meminfo_numa_linux_test.go b/collector/meminfo_numa_linux_test.go index a17714e8df..33bc362e39 100644 --- a/collector/meminfo_numa_linux_test.go +++ b/collector/meminfo_numa_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nomeminfo_numa +// +build !nomeminfo_numa + package collector import ( diff --git a/collector/meminfo_openbsd.go b/collector/meminfo_openbsd.go index 2c81c50ccd..c5d2947ec7 100644 --- a/collector/meminfo_openbsd.go +++ b/collector/meminfo_openbsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build openbsd && !amd64 && !nomeminfo -// +build openbsd,!amd64,!nomeminfo +//go:build !nomeminfo && !amd64 +// +build !nomeminfo,!amd64 package collector diff --git a/collector/memory_bsd.go b/collector/memory_bsd.go index 3039e6df89..6af9d8aaa4 100644 --- a/collector/memory_bsd.go +++ b/collector/memory_bsd.go @@ -87,6 +87,7 @@ func NewMemoryCollector(logger log.Logger) (Collector, error) { description: "Locked in memory by user, mlock, etc", mib: "vm.stats.vm.v_user_wire_count", conversion: fromPage, + dataType: bsdSysctlTypeCLong, }, { name: "cache_bytes", diff --git a/collector/netclass_linux.go b/collector/netclass_linux.go index a1a3fa72d8..327c89aaf4 100644 --- a/collector/netclass_linux.go +++ b/collector/netclass_linux.go @@ -19,19 +19,22 @@ package collector import ( "errors" "fmt" + "net" "os" "regexp" + "sync" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" - "gopkg.in/alecthomas/kingpin.v2" ) var ( netclassIgnoredDevices = kingpin.Flag("collector.netclass.ignored-devices", "Regexp of net devices to ignore for netclass collector.").Default("^$").String() netclassInvalidSpeed = kingpin.Flag("collector.netclass.ignore-invalid-speed", "Ignore devices where the speed is invalid. This will be the default behavior in 2.x.").Bool() + netclassNetlink = kingpin.Flag("collector.netclass.netlink", "Use netlink to gather stats instead of /proc/net/dev.").Default("false").Bool() ) type netClassCollector struct { @@ -39,6 +42,7 @@ type netClassCollector struct { subsystem string ignoredDevicesPattern *regexp.Regexp metricDescs map[string]*prometheus.Desc + metricDescsMu sync.Mutex logger log.Logger } @@ -63,6 +67,13 @@ func NewNetClassCollector(logger log.Logger) (Collector, error) { } func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error { + if *netclassNetlink { + return c.netClassRTNLUpdate(ch) + } + return c.netClassSysfsUpdate(ch) +} + +func (c *netClassCollector) netClassSysfsUpdate(ch chan<- prometheus.Metric) error { netClass, err := c.getNetClassInfo() if err != nil { if errors.Is(err, os.ErrNotExist) || errors.Is(err, os.ErrPermission) { @@ -88,98 +99,61 @@ func (c *netClassCollector) Update(ch chan<- prometheus.Metric) error { infoDesc := prometheus.NewDesc( prometheus.BuildFQName(namespace, c.subsystem, "info"), "Non-numeric data from /sys/class/net/, value is always 1.", - []string{"device", "address", "broadcast", "duplex", "operstate", "ifalias"}, + []string{"device", "address", "broadcast", "duplex", "operstate", "adminstate", "ifalias"}, nil, ) infoValue := 1.0 - ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, ifaceInfo.Name, ifaceInfo.Address, ifaceInfo.Broadcast, ifaceInfo.Duplex, ifaceInfo.OperState, ifaceInfo.IfAlias) - - if ifaceInfo.AddrAssignType != nil { - pushMetric(ch, c.subsystem, "address_assign_type", *ifaceInfo.AddrAssignType, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.Carrier != nil { - pushMetric(ch, c.subsystem, "carrier", *ifaceInfo.Carrier, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.CarrierChanges != nil { - pushMetric(ch, c.subsystem, "carrier_changes_total", *ifaceInfo.CarrierChanges, ifaceInfo.Name, prometheus.CounterValue) - } - - if ifaceInfo.CarrierUpCount != nil { - pushMetric(ch, c.subsystem, "carrier_up_changes_total", *ifaceInfo.CarrierUpCount, ifaceInfo.Name, prometheus.CounterValue) - } - - if ifaceInfo.CarrierDownCount != nil { - pushMetric(ch, c.subsystem, "carrier_down_changes_total", *ifaceInfo.CarrierDownCount, ifaceInfo.Name, prometheus.CounterValue) - } - - if ifaceInfo.DevID != nil { - pushMetric(ch, c.subsystem, "device_id", *ifaceInfo.DevID, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.Dormant != nil { - pushMetric(ch, c.subsystem, "dormant", *ifaceInfo.Dormant, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.Flags != nil { - pushMetric(ch, c.subsystem, "flags", *ifaceInfo.Flags, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.IfIndex != nil { - pushMetric(ch, c.subsystem, "iface_id", *ifaceInfo.IfIndex, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.IfLink != nil { - pushMetric(ch, c.subsystem, "iface_link", *ifaceInfo.IfLink, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.LinkMode != nil { - pushMetric(ch, c.subsystem, "iface_link_mode", *ifaceInfo.LinkMode, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.MTU != nil { - pushMetric(ch, c.subsystem, "mtu_bytes", *ifaceInfo.MTU, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.NameAssignType != nil { - pushMetric(ch, c.subsystem, "name_assign_type", *ifaceInfo.NameAssignType, ifaceInfo.Name, prometheus.GaugeValue) - } - - if ifaceInfo.NetDevGroup != nil { - pushMetric(ch, c.subsystem, "net_dev_group", *ifaceInfo.NetDevGroup, ifaceInfo.Name, prometheus.GaugeValue) - } + ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, ifaceInfo.Name, ifaceInfo.Address, ifaceInfo.Broadcast, ifaceInfo.Duplex, ifaceInfo.OperState, getAdminState(ifaceInfo.Flags), ifaceInfo.IfAlias) + + pushMetric(ch, c.getFieldDesc("address_assign_type"), "address_assign_type", ifaceInfo.AddrAssignType, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("carrier"), "carrier", ifaceInfo.Carrier, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("carrier_changes_total"), "carrier_changes_total", ifaceInfo.CarrierChanges, prometheus.CounterValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("carrier_up_changes_total"), "carrier_up_changes_total", ifaceInfo.CarrierUpCount, prometheus.CounterValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("carrier_down_changes_total"), "carrier_down_changes_total", ifaceInfo.CarrierDownCount, prometheus.CounterValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("device_id"), "device_id", ifaceInfo.DevID, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("dormant"), "dormant", ifaceInfo.Dormant, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("flags"), "flags", ifaceInfo.Flags, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("iface_id"), "iface_id", ifaceInfo.IfIndex, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("iface_link"), "iface_link", ifaceInfo.IfLink, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("iface_link_mode"), "iface_link_mode", ifaceInfo.LinkMode, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("mtu_bytes"), "mtu_bytes", ifaceInfo.MTU, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("name_assign_type"), "name_assign_type", ifaceInfo.NameAssignType, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("net_dev_group"), "net_dev_group", ifaceInfo.NetDevGroup, prometheus.GaugeValue, ifaceInfo.Name) if ifaceInfo.Speed != nil { // Some devices return -1 if the speed is unknown. if *ifaceInfo.Speed >= 0 || !*netclassInvalidSpeed { speedBytes := int64(*ifaceInfo.Speed * 1000 * 1000 / 8) - pushMetric(ch, c.subsystem, "speed_bytes", speedBytes, ifaceInfo.Name, prometheus.GaugeValue) + pushMetric(ch, c.getFieldDesc("speed_bytes"), "speed_bytes", speedBytes, prometheus.GaugeValue, ifaceInfo.Name) } } - if ifaceInfo.TxQueueLen != nil { - pushMetric(ch, c.subsystem, "transmit_queue_length", *ifaceInfo.TxQueueLen, ifaceInfo.Name, prometheus.GaugeValue) - } + pushMetric(ch, c.getFieldDesc("transmit_queue_length"), "transmit_queue_length", ifaceInfo.TxQueueLen, prometheus.GaugeValue, ifaceInfo.Name) + pushMetric(ch, c.getFieldDesc("protocol_type"), "protocol_type", ifaceInfo.Type, prometheus.GaugeValue, ifaceInfo.Name) - if ifaceInfo.Type != nil { - pushMetric(ch, c.subsystem, "protocol_type", *ifaceInfo.Type, ifaceInfo.Name, prometheus.GaugeValue) - } } return nil } -func pushMetric(ch chan<- prometheus.Metric, subsystem string, name string, value int64, ifaceName string, valueType prometheus.ValueType) { - fieldDesc := prometheus.NewDesc( - prometheus.BuildFQName(namespace, subsystem, name), - fmt.Sprintf("%s value of /sys/class/net/.", name), - []string{"device"}, - nil, - ) +func (c *netClassCollector) getFieldDesc(name string) *prometheus.Desc { + c.metricDescsMu.Lock() + defer c.metricDescsMu.Unlock() + + fieldDesc, exists := c.metricDescs[name] - ch <- prometheus.MustNewConstMetric(fieldDesc, valueType, float64(value), ifaceName) + if !exists { + fieldDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, c.subsystem, name), + fmt.Sprintf("Network device property: %s", name), + []string{"device"}, + nil, + ) + c.metricDescs[name] = fieldDesc + } + + return fieldDesc } func (c *netClassCollector) getNetClassInfo() (sysfs.NetClass, error) { @@ -202,3 +176,15 @@ func (c *netClassCollector) getNetClassInfo() (sysfs.NetClass, error) { return netClass, nil } + +func getAdminState(flags *int64) string { + if flags == nil { + return "unknown" + } + + if *flags&int64(net.FlagUp) == 1 { + return "up" + } + + return "down" +} diff --git a/collector/netclass_rtnl_linux.go b/collector/netclass_rtnl_linux.go new file mode 100644 index 0000000000..ef963715e5 --- /dev/null +++ b/collector/netclass_rtnl_linux.go @@ -0,0 +1,230 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nonetclass && linux +// +build !nonetclass,linux + +package collector + +import ( + "errors" + "fmt" + "io/fs" + "path/filepath" + + "github.com/alecthomas/kingpin/v2" + "github.com/go-kit/log/level" + "github.com/jsimonetti/rtnetlink" + "github.com/mdlayher/ethtool" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs/sysfs" +) + +var ( + netclassRTNLWithStats = kingpin.Flag("collector.netclass_rtnl.with-stats", "Expose the statistics for each network device, replacing netdev collector.").Bool() + operstateStr = []string{ + "unknown", "notpresent", "down", "lowerlayerdown", "testing", + "dormant", "up", + } +) + +func (c *netClassCollector) netClassRTNLUpdate(ch chan<- prometheus.Metric) error { + linkModes := make(map[string]*ethtool.LinkMode) + lms, err := c.getLinkModes() + if err != nil { + if !errors.Is(errors.Unwrap(err), fs.ErrNotExist) { + return fmt.Errorf("could not get link modes: %w", err) + } + level.Info(c.logger).Log("msg", "ETHTOOL netlink interface unavailable, duplex and linkspeed are not scraped.") + } else { + for _, lm := range lms { + if c.ignoredDevicesPattern.MatchString(lm.Interface.Name) { + continue + } + if lm.SpeedMegabits >= 0 { + speedBytes := uint64(lm.SpeedMegabits * 1000 * 1000 / 8) + pushMetric(ch, c.getFieldDesc("speed_bytes"), "speed_bytes", speedBytes, prometheus.GaugeValue, lm.Interface.Name) + } + linkModes[lm.Interface.Name] = lm + } + } + + // Get most attributes from Netlink + lMsgs, err := c.getNetClassInfoRTNL() + if err != nil { + return fmt.Errorf("could not get net class info: %w", err) + } + + relevantLinks := make([]rtnetlink.LinkMessage, 0, len(lMsgs)) + for _, msg := range lMsgs { + if !c.ignoredDevicesPattern.MatchString(msg.Attributes.Name) { + relevantLinks = append(relevantLinks, msg) + } + } + + // Read sysfs for attributes that Netlink doesn't expose + sysfsAttrs, err := getSysfsAttributes(relevantLinks) + if err != nil { + return fmt.Errorf("could not get sysfs device info: %w", err) + } + + // Parse all the info and update metrics + for _, msg := range relevantLinks { + upDesc := prometheus.NewDesc( + prometheus.BuildFQName(namespace, c.subsystem, "up"), + "Value is 1 if operstate is 'up', 0 otherwise.", + []string{"device"}, + nil, + ) + upValue := 0.0 + if msg.Attributes.OperationalState == rtnetlink.OperStateUp { + upValue = 1.0 + } + ch <- prometheus.MustNewConstMetric(upDesc, prometheus.GaugeValue, upValue, msg.Attributes.Name) + + infoDesc := prometheus.NewDesc( + prometheus.BuildFQName(namespace, c.subsystem, "info"), + "Non-numeric data of , value is always 1.", + []string{"device", "address", "broadcast", "duplex", "operstate", "ifalias"}, + nil, + ) + infoValue := 1.0 + + var ifalias = "" + if msg.Attributes.Alias != nil { + ifalias = *msg.Attributes.Alias + } + + duplex := "" + lm, lmExists := linkModes[msg.Attributes.Name] + if lmExists { + duplex = lm.Duplex.String() + } + + ifaceInfo := sysfsAttrs[msg.Attributes.Name] + + ch <- prometheus.MustNewConstMetric(infoDesc, prometheus.GaugeValue, infoValue, msg.Attributes.Name, msg.Attributes.Address.String(), msg.Attributes.Broadcast.String(), duplex, operstateStr[int(msg.Attributes.OperationalState)], ifalias) + + pushMetric(ch, c.getFieldDesc("address_assign_type"), "address_assign_type", ifaceInfo.AddrAssignType, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("carrier"), "carrier", msg.Attributes.Carrier, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("carrier_changes_total"), "carrier_changes_total", msg.Attributes.CarrierChanges, prometheus.CounterValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("carrier_up_changes_total"), "carrier_up_changes_total", msg.Attributes.CarrierUpCount, prometheus.CounterValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("carrier_down_changes_total"), "carrier_down_changes_total", msg.Attributes.CarrierDownCount, prometheus.CounterValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("device_id"), "device_id", ifaceInfo.DevID, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("flags"), "flags", msg.Flags, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("iface_id"), "iface_id", msg.Index, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("iface_link_mode"), "iface_link_mode", msg.Attributes.LinkMode, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("dormant"), "dormant", msg.Attributes.LinkMode, prometheus.GaugeValue, msg.Attributes.Name) + + // kernel logic: IFLA_LINK attribute will be ignore when ifindex is the same as iflink + // (dev->ifindex != dev_get_iflink(dev) && nla_put_u32(skb, IFLA_LINK, dev_get_iflink(dev))) + // As interface ID is never 0, we assume msg.Attributes.Type 0 means iflink is omitted in RTM_GETLINK response. + if msg.Attributes.Type > 0 { + pushMetric(ch, c.getFieldDesc("iface_link"), "iface_link", msg.Attributes.Type, prometheus.GaugeValue, msg.Attributes.Name) + } else { + pushMetric(ch, c.getFieldDesc("iface_link"), "iface_link", msg.Index, prometheus.GaugeValue, msg.Attributes.Name) + } + + pushMetric(ch, c.getFieldDesc("mtu_bytes"), "mtu_bytes", msg.Attributes.MTU, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("name_assign_type"), "name_assign_type", ifaceInfo.NameAssignType, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("net_dev_group"), "net_dev_group", msg.Attributes.NetDevGroup, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_queue_length"), "transmit_queue_length", msg.Attributes.TxQueueLen, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("protocol_type"), "protocol_type", msg.Type, prometheus.GaugeValue, msg.Attributes.Name) + + // Skip statistics if argument collector.netclass_rtnl.with-stats is false or statistics are unavailable. + if netclassRTNLWithStats == nil || !*netclassRTNLWithStats || msg.Attributes.Stats64 == nil { + continue + } + + pushMetric(ch, c.getFieldDesc("receive_packets_total"), "receive_packets_total", msg.Attributes.Stats64.RXPackets, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_packets_total"), "transmit_packets_total", msg.Attributes.Stats64.TXPackets, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_bytes_total"), "receive_bytes_total", msg.Attributes.Stats64.RXBytes, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_bytes_total"), "transmit_bytes_total", msg.Attributes.Stats64.TXBytes, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_errors_total"), "receive_errors_total", msg.Attributes.Stats64.RXErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_errors_total"), "transmit_errors_total", msg.Attributes.Stats64.TXErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_dropped_total"), "receive_dropped_total", msg.Attributes.Stats64.RXDropped, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_dropped_total"), "transmit_dropped_total", msg.Attributes.Stats64.TXDropped, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("multicast_total"), "multicast_total", msg.Attributes.Stats64.Multicast, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("collisions_total"), "collisions_total", msg.Attributes.Stats64.Collisions, prometheus.GaugeValue, msg.Attributes.Name) + + // Detailed rx_errors. + pushMetric(ch, c.getFieldDesc("receive_length_errors_total"), "receive_length_errors_total", msg.Attributes.Stats64.RXLengthErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_over_errors_total"), "receive_over_errors_total", msg.Attributes.Stats64.RXOverErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_crc_errors_total"), "receive_crc_errors_total", msg.Attributes.Stats64.RXCRCErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_frame_errors_total"), "receive_frame_errors_total", msg.Attributes.Stats64.RXFrameErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_fifo_errors_total"), "receive_fifo_errors_total", msg.Attributes.Stats64.RXFIFOErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_missed_errors_total"), "receive_missed_errors_total", msg.Attributes.Stats64.RXMissedErrors, prometheus.GaugeValue, msg.Attributes.Name) + + // Detailed tx_errors. + pushMetric(ch, c.getFieldDesc("transmit_aborted_errors_total"), "transmit_aborted_errors_total", msg.Attributes.Stats64.TXAbortedErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_carrier_errors_total"), "transmit_carrier_errors_total", msg.Attributes.Stats64.TXCarrierErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_fifo_errors_total"), "transmit_fifo_errors_total", msg.Attributes.Stats64.TXFIFOErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_heartbeat_errors_total"), "transmit_heartbeat_errors_total", msg.Attributes.Stats64.TXHeartbeatErrors, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_window_errors_total"), "transmit_window_errors_total", msg.Attributes.Stats64.TXWindowErrors, prometheus.GaugeValue, msg.Attributes.Name) + + // For cslip, etc. + pushMetric(ch, c.getFieldDesc("receive_compressed_total"), "receive_compressed_total", msg.Attributes.Stats64.RXCompressed, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("transmit_compressed_total"), "transmit_compressed_total", msg.Attributes.Stats64.TXCompressed, prometheus.GaugeValue, msg.Attributes.Name) + pushMetric(ch, c.getFieldDesc("receive_nohandler_total"), "receive_nohandler_total", msg.Attributes.Stats64.RXNoHandler, prometheus.GaugeValue, msg.Attributes.Name) + + } + + return nil +} + +func (c *netClassCollector) getNetClassInfoRTNL() ([]rtnetlink.LinkMessage, error) { + conn, err := rtnetlink.Dial(nil) + if err != nil { + return nil, err + } + defer conn.Close() + + lMsgs, err := conn.Link.List() + + return lMsgs, err + +} + +func (c *netClassCollector) getLinkModes() ([]*ethtool.LinkMode, error) { + conn, err := ethtool.New() + if err != nil { + return nil, err + } + defer conn.Close() + + lms, err := conn.LinkModes() + + return lms, err +} + +// getSysfsAttributes reads attributes that are absent from netlink but provided +// by sysfs. +func getSysfsAttributes(links []rtnetlink.LinkMessage) (sysfs.NetClass, error) { + netClass := sysfs.NetClass{} + for _, msg := range links { + interfaceClass := sysfs.NetClassIface{} + ifName := msg.Attributes.Name + devPath := filepath.Join("/sys", "class", "net", ifName) + + // These three attributes hold a device-specific lock when + // accessed, not the RTNL lock, so they are much less impactful + // than reading most of the other attributes from sysfs. + for _, attr := range []string{"addr_assign_type", "dev_id", "name_assign_type"} { + if err := sysfs.ParseNetClassAttribute(devPath, attr, &interfaceClass); err != nil { + return nil, err + } + } + netClass[ifName] = interfaceClass + } + return netClass, nil +} diff --git a/collector/netdev_common.go b/collector/netdev_common.go index 0a9b522b84..089f1e5870 100644 --- a/collector/netdev_common.go +++ b/collector/netdev_common.go @@ -24,10 +24,10 @@ import ( "strconv" "sync" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) var ( diff --git a/collector/netdev_linux.go b/collector/netdev_linux.go index 325d10b7b1..f3348cda73 100644 --- a/collector/netdev_linux.go +++ b/collector/netdev_linux.go @@ -17,39 +17,92 @@ package collector import ( + "fmt" + + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/jsimonetti/rtnetlink" + "github.com/prometheus/procfs" +) + +var ( + netDevNetlink = kingpin.Flag("collector.netdev.netlink", "Use netlink to gather stats instead of /proc/net/dev.").Default("true").Bool() ) func getNetDevStats(filter *deviceFilter, logger log.Logger) (netDevStats, error) { + if *netDevNetlink { + return netlinkStats(filter, logger) + } + return procNetDevStats(filter, logger) +} + +func netlinkStats(filter *deviceFilter, logger log.Logger) (netDevStats, error) { conn, err := rtnetlink.Dial(nil) if err != nil { return nil, err } - defer conn.Close() + defer conn.Close() links, err := conn.Link.List() if err != nil { return nil, err } - return netlinkStats(links, filter, logger), nil + return parseNetlinkStats(links, filter, logger), nil } -func netlinkStats(links []rtnetlink.LinkMessage, filter *deviceFilter, logger log.Logger) netDevStats { +func parseNetlinkStats(links []rtnetlink.LinkMessage, filter *deviceFilter, logger log.Logger) netDevStats { metrics := netDevStats{} for _, msg := range links { + if msg.Attributes == nil { + level.Debug(logger).Log("msg", "No netlink attributes, skipping") + continue + } name := msg.Attributes.Name stats := msg.Attributes.Stats64 + if stats32 := msg.Attributes.Stats; stats == nil && stats32 != nil { + stats = &rtnetlink.LinkStats64{ + RXPackets: uint64(stats32.RXPackets), + TXPackets: uint64(stats32.TXPackets), + RXBytes: uint64(stats32.RXBytes), + TXBytes: uint64(stats32.TXBytes), + RXErrors: uint64(stats32.RXErrors), + TXErrors: uint64(stats32.TXErrors), + RXDropped: uint64(stats32.RXDropped), + TXDropped: uint64(stats32.TXDropped), + Multicast: uint64(stats32.Multicast), + Collisions: uint64(stats32.Collisions), + RXLengthErrors: uint64(stats32.RXLengthErrors), + RXOverErrors: uint64(stats32.RXOverErrors), + RXCRCErrors: uint64(stats32.RXCRCErrors), + RXFrameErrors: uint64(stats32.RXFrameErrors), + RXFIFOErrors: uint64(stats32.RXFIFOErrors), + RXMissedErrors: uint64(stats32.RXMissedErrors), + TXAbortedErrors: uint64(stats32.TXAbortedErrors), + TXCarrierErrors: uint64(stats32.TXCarrierErrors), + TXFIFOErrors: uint64(stats32.TXFIFOErrors), + TXHeartbeatErrors: uint64(stats32.TXHeartbeatErrors), + TXWindowErrors: uint64(stats32.TXWindowErrors), + RXCompressed: uint64(stats32.RXCompressed), + TXCompressed: uint64(stats32.TXCompressed), + RXNoHandler: uint64(stats32.RXNoHandler), + RXOtherhostDropped: 0, + } + } if filter.ignored(name) { level.Debug(logger).Log("msg", "Ignoring device", "device", name) continue } + // Make sure we don't panic when accessing `stats` attributes below. + if stats == nil { + level.Debug(logger).Log("msg", "No netlink stats, skipping") + continue + } + // https://github.com/torvalds/linux/blob/master/include/uapi/linux/if_link.h#L42-L246 metrics[name] = map[string]uint64{ "receive_packets": stats.RXPackets, @@ -87,3 +140,47 @@ func netlinkStats(links []rtnetlink.LinkMessage, filter *deviceFilter, logger lo return metrics } + +func procNetDevStats(filter *deviceFilter, logger log.Logger) (netDevStats, error) { + metrics := netDevStats{} + + fs, err := procfs.NewFS(*procPath) + if err != nil { + return metrics, fmt.Errorf("failed to open procfs: %w", err) + } + + netDev, err := fs.NetDev() + if err != nil { + return metrics, fmt.Errorf("failed to parse /proc/net/dev: %w", err) + } + + for _, stats := range netDev { + name := stats.Name + + if filter.ignored(name) { + level.Debug(logger).Log("msg", "Ignoring device", "device", name) + continue + } + + metrics[name] = map[string]uint64{ + "receive_bytes": stats.RxBytes, + "receive_packets": stats.RxPackets, + "receive_errors": stats.RxErrors, + "receive_dropped": stats.RxDropped, + "receive_fifo": stats.RxFIFO, + "receive_frame": stats.RxFrame, + "receive_compressed": stats.RxCompressed, + "receive_multicast": stats.RxMulticast, + "transmit_bytes": stats.TxBytes, + "transmit_packets": stats.TxPackets, + "transmit_errors": stats.TxErrors, + "transmit_dropped": stats.TxDropped, + "transmit_fifo": stats.TxFIFO, + "transmit_colls": stats.TxCollisions, + "transmit_carrier": stats.TxCarrier, + "transmit_compressed": stats.TxCompressed, + } + } + + return metrics, nil +} diff --git a/collector/netdev_linux_test.go b/collector/netdev_linux_test.go index 32e3d16bda..7909d01821 100644 --- a/collector/netdev_linux_test.go +++ b/collector/netdev_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nonetdev +// +build !nonetdev + package collector import ( @@ -163,7 +166,7 @@ var links = []rtnetlink.LinkMessage{ func TestNetDevStatsIgnore(t *testing.T) { filter := newDeviceFilter("^veth", "") - netStats := netlinkStats(links, &filter, log.NewNopLogger()) + netStats := parseNetlinkStats(links, &filter, log.NewNopLogger()) if want, got := uint64(10437182923), netStats["wlan0"]["receive_bytes"]; want != got { t.Errorf("want netstat wlan0 bytes %v, got %v", want, got) @@ -196,7 +199,7 @@ func TestNetDevStatsIgnore(t *testing.T) { func TestNetDevStatsAccept(t *testing.T) { filter := newDeviceFilter("", "^💩0$") - netStats := netlinkStats(links, &filter, log.NewNopLogger()) + netStats := parseNetlinkStats(links, &filter, log.NewNopLogger()) if want, got := 1, len(netStats); want != got { t.Errorf("want count of devices to be %d, got %d", want, got) @@ -227,7 +230,7 @@ func TestNetDevLegacyMetricNames(t *testing.T) { } filter := newDeviceFilter("", "") - netStats := netlinkStats(links, &filter, log.NewNopLogger()) + netStats := parseNetlinkStats(links, &filter, log.NewNopLogger()) for dev, devStats := range netStats { legacy(devStats) @@ -260,7 +263,7 @@ func TestNetDevLegacyMetricValues(t *testing.T) { } filter := newDeviceFilter("", "^enp0s0f0$") - netStats := netlinkStats(links, &filter, log.NewNopLogger()) + netStats := parseNetlinkStats(links, &filter, log.NewNopLogger()) metrics, ok := netStats["enp0s0f0"] if !ok { t.Error("expected stats for interface enp0s0f0") @@ -282,7 +285,7 @@ func TestNetDevLegacyMetricValues(t *testing.T) { func TestNetDevMetricValues(t *testing.T) { filter := newDeviceFilter("", "") - netStats := netlinkStats(links, &filter, log.NewNopLogger()) + netStats := parseNetlinkStats(links, &filter, log.NewNopLogger()) for _, msg := range links { device := msg.Attributes.Name diff --git a/collector/netdev_openbsd.go b/collector/netdev_openbsd.go index 5d53678d9b..b90e3ba7ab 100644 --- a/collector/netdev_openbsd.go +++ b/collector/netdev_openbsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build openbsd && !amd64 && !nonetdev -// +build openbsd,!amd64,!nonetdev +//go:build !nonetdev && !amd64 +// +build !nonetdev,!amd64 package collector diff --git a/collector/netisr_freebsd.go b/collector/netisr_freebsd.go new file mode 100644 index 0000000000..442bcdc6a7 --- /dev/null +++ b/collector/netisr_freebsd.go @@ -0,0 +1,105 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nonetisr +// +build !nonetisr + +package collector + +import ( + "fmt" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" +) + +type netisrCollector struct { + sysctls []bsdSysctl + logger log.Logger +} + +const ( + netisrCollectorSubsystem = "netisr" +) + +func init() { + registerCollector("netisr", defaultEnabled, NewNetisrCollector) +} + +func NewNetisrCollector(logger log.Logger) (Collector, error) { + return &netisrCollector{ + sysctls: []bsdSysctl{ + { + name: "numthreads", + description: "netisr current thread count", + mib: "net.isr.numthreads", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + { + name: "maxprot", + description: "netisr maximum protocols", + mib: "net.isr.maxprot", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + { + name: "defaultqlimit", + description: "netisr default queue limit", + mib: "net.isr.defaultqlimit", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + { + name: "maxqlimit", + description: "netisr maximum queue limit", + mib: "net.isr.maxqlimit", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + { + name: "bindthreads", + description: "netisr threads bound to CPUs", + mib: "net.isr.bindthreads", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + { + name: "maxthreads", + description: "netisr maximum thread count", + mib: "net.isr.maxthreads", + dataType: bsdSysctlTypeUint32, + valueType: prometheus.GaugeValue, + }, + }, + logger: logger, + }, nil +} + +func (c *netisrCollector) Update(ch chan<- prometheus.Metric) error { + for _, m := range c.sysctls { + v, err := m.Value() + if err != nil { + return fmt.Errorf("couldn't get sysctl: %w", err) + } + + ch <- prometheus.MustNewConstMetric( + prometheus.NewDesc( + prometheus.BuildFQName(namespace, netisrCollectorSubsystem, m.name), + m.description, + nil, nil, + ), m.valueType, v) + } + + return nil +} diff --git a/collector/netstat_linux.go b/collector/netstat_linux.go index a034ab6415..8e4c9f4de8 100644 --- a/collector/netstat_linux.go +++ b/collector/netstat_linux.go @@ -26,9 +26,9 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -36,7 +36,7 @@ const ( ) var ( - netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() + netStatFields = kingpin.Flag("collector.netstat.fields", "Regexp of fields to return for netstat collector.").Default("^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts|TCPOFOQueue)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$").String() ) type netStatCollector struct { diff --git a/collector/netstat_linux_test.go b/collector/netstat_linux_test.go index a27382b416..ec430bc3e3 100644 --- a/collector/netstat_linux_test.go +++ b/collector/netstat_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nonetstat +// +build !nonetstat + package collector import ( diff --git a/collector/nfsd_linux.go b/collector/nfsd_linux.go index faa6c960b3..8b310ea23c 100644 --- a/collector/nfsd_linux.go +++ b/collector/nfsd_linux.go @@ -82,6 +82,8 @@ func (c *nfsdCollector) Update(ch chan<- prometheus.Metric) error { c.updateNFSdRequestsv2Stats(ch, &stats.V2Stats) c.updateNFSdRequestsv3Stats(ch, &stats.V3Stats) c.updateNFSdRequestsv4Stats(ch, &stats.V4Ops) + ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, + float64(stats.WdelegGetattr), "4", "WdelegGetattr") return nil } @@ -395,6 +397,10 @@ func (c *nfsdCollector) updateNFSdRequestsv4Stats(ch chan<- prometheus.Metric, s float64(s.SecInfo), proto, "SecInfo") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.SetAttr), proto, "SetAttr") + ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, + float64(s.SetClientID), proto, "SetClientID") + ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, + float64(s.SetClientIDConfirm), proto, "SetClientIDConfirm") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, float64(s.Verify), proto, "Verify") ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue, diff --git a/collector/ntp.go b/collector/ntp.go index c9cdcc3fc6..6cff69cafc 100644 --- a/collector/ntp.go +++ b/collector/ntp.go @@ -22,10 +22,11 @@ import ( "sync" "time" + "github.com/alecthomas/kingpin/v2" "github.com/beevik/ntp" "github.com/go-kit/log" + "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -79,6 +80,7 @@ func NewNtpCollector(logger log.Logger) (Collector, error) { return nil, fmt.Errorf("invalid NTP port number %d; must be between 1 and 65535 inclusive", *ntpServerPort) } + level.Warn(logger).Log("msg", "This collector is deprecated and will be removed in the next major version release.") return &ntpCollector{ stratum: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, ntpSubsystem, "stratum"), diff --git a/collector/nvme_linux.go b/collector/nvme_linux.go index 15af5d7563..81d4ab2985 100644 --- a/collector/nvme_linux.go +++ b/collector/nvme_linux.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !nonvme -// +build linux,!nonvme +//go:build !nonvme +// +build !nonvme package collector diff --git a/collector/os_release.go b/collector/os_release.go index 14a025a454..4c86740e61 100644 --- a/collector/os_release.go +++ b/collector/os_release.go @@ -53,18 +53,19 @@ type osRelease struct { BuildID string ImageID string ImageVersion string + SupportEnd string } type osReleaseCollector struct { infoDesc *prometheus.Desc logger log.Logger os *osRelease - osFilename string // file name of cached release information - osMtime time.Time // mtime of cached release file osMutex sync.RWMutex osReleaseFilenames []string // all os-release file names to check version float64 versionDesc *prometheus.Desc + supportEnd time.Time + supportEndDesc *prometheus.Desc } type Plist struct { @@ -97,6 +98,11 @@ func NewOSCollector(logger log.Logger) (Collector, error) { "Metric containing the major.minor part of the OS version.", []string{"id", "id_like", "name"}, nil, ), + supportEndDesc: prometheus.NewDesc( + prometheus.BuildFQName(namespace, "os", "support_end_timestamp_seconds"), + "Metric containing the end-of-life date timestamp of the OS.", + nil, nil, + ), }, nil } @@ -115,6 +121,7 @@ func parseOSRelease(r io.Reader) (*osRelease, error) { BuildID: env["BUILD_ID"], ImageID: env["IMAGE_ID"], ImageVersion: env["IMAGE_VERSION"], + SupportEnd: env["SUPPORT_END"], }, err } @@ -125,28 +132,10 @@ func (c *osReleaseCollector) UpdateStruct(path string) error { } defer releaseFile.Close() - stat, err := releaseFile.Stat() - if err != nil { - return err - } - - t := stat.ModTime() - c.osMutex.RLock() - upToDate := path == c.osFilename && t == c.osMtime - c.osMutex.RUnlock() - if upToDate { - // osReleaseCollector struct is already up-to-date. - return nil - } - // Acquire a lock to update the osReleaseCollector struct. c.osMutex.Lock() defer c.osMutex.Unlock() - level.Debug(c.logger).Log("msg", "file modification time has changed", - "file", path, "old_value", c.osMtime, "new_value", t) - c.osFilename = path - c.osMtime = t // SystemVersion.plist is xml file with MacOs version info if strings.Contains(releaseFile.Name(), "SystemVersion.plist") { c.os, err = getMacosProductVersion(releaseFile.Name()) @@ -169,6 +158,15 @@ func (c *osReleaseCollector) UpdateStruct(path string) error { } else { c.version = 0 } + + if c.os.SupportEnd != "" { + c.supportEnd, err = time.Parse(time.DateOnly, c.os.SupportEnd) + + if err != nil { + return err + } + } + return nil } @@ -195,6 +193,11 @@ func (c *osReleaseCollector) Update(ch chan<- prometheus.Metric) error { ch <- prometheus.MustNewConstMetric(c.versionDesc, prometheus.GaugeValue, c.version, c.os.ID, c.os.IDLike, c.os.Name) } + + if c.os.SupportEnd != "" { + ch <- prometheus.MustNewConstMetric(c.supportEndDesc, prometheus.GaugeValue, float64(c.supportEnd.Unix())) + } + return nil } diff --git a/collector/os_release_test.go b/collector/os_release_test.go index 46838f15f1..b45ee0edfa 100644 --- a/collector/os_release_test.go +++ b/collector/os_release_test.go @@ -33,12 +33,28 @@ SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" ` +const nixosTapir string = `BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues" +BUILD_ID="23.11.20240328.219951b" +DOCUMENTATION_URL="https://nixos.org/learn.html" +HOME_URL="https://nixos.org/" +ID=nixos +LOGO="nix-snowflake" +NAME=NixOS +PRETTY_NAME="NixOS 23.11 (Tapir)" +SUPPORT_END="2024-06-30" +SUPPORT_URL="https://nixos.org/community.html" +VERSION="23.11 (Tapir)" +VERSION_CODENAME=tapir +VERSION_ID="23.11" +` + func TestParseOSRelease(t *testing.T) { want := &osRelease{ Name: "Ubuntu", ID: "ubuntu", IDLike: "debian", PrettyName: "Ubuntu 20.04.2 LTS", + SupportEnd: "", Version: "20.04.2 LTS (Focal Fossa)", VersionID: "20.04", VersionCodename: "focal", @@ -75,6 +91,32 @@ func TestParseOSRelease(t *testing.T) { } } +func TestParseOSSupportEnd(t *testing.T) { + want := &osRelease{ + BuildID: "23.11.20240328.219951b", + Name: "NixOS", + ID: "nixos", + IDLike: "", + ImageID: "", + ImageVersion: "", + PrettyName: "NixOS 23.11 (Tapir)", + SupportEnd: "2024-06-30", + Variant: "", + VariantID: "", + Version: "23.11 (Tapir)", + VersionID: "23.11", + VersionCodename: "tapir", + } + + got, err := parseOSRelease(strings.NewReader(nixosTapir)) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(want, got) { + t.Fatalf("should have %+v osRelease: got %+v", want, got) + } +} + func TestUpdateStruct(t *testing.T) { wantedOS := &osRelease{ Name: "Ubuntu", diff --git a/collector/paths.go b/collector/paths.go index 61aa64708d..82c941876d 100644 --- a/collector/paths.go +++ b/collector/paths.go @@ -17,8 +17,8 @@ import ( "path/filepath" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/procfs" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( diff --git a/collector/paths_test.go b/collector/paths_test.go index eca7b3a48d..9426fa4b8a 100644 --- a/collector/paths_test.go +++ b/collector/paths_test.go @@ -16,8 +16,8 @@ package collector import ( "testing" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/procfs" - "gopkg.in/alecthomas/kingpin.v2" ) func TestDefaultProcPath(t *testing.T) { diff --git a/collector/perf_linux.go b/collector/perf_linux.go index 812dbaf874..8934371ad0 100644 --- a/collector/perf_linux.go +++ b/collector/perf_linux.go @@ -22,12 +22,12 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/hodgesds/perf-utils" "github.com/prometheus/client_golang/prometheus" "golang.org/x/sys/unix" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -37,12 +37,67 @@ const ( var ( perfCPUsFlag = kingpin.Flag("collector.perf.cpus", "List of CPUs from which perf metrics should be collected").Default("").String() perfTracepointFlag = kingpin.Flag("collector.perf.tracepoint", "perf tracepoint that should be collected").Strings() + perfNoHwProfiler = kingpin.Flag("collector.perf.disable-hardware-profilers", "disable perf hardware profilers").Default("false").Bool() + perfHwProfilerFlag = kingpin.Flag("collector.perf.hardware-profilers", "perf hardware profilers that should be collected").Strings() + perfNoSwProfiler = kingpin.Flag("collector.perf.disable-software-profilers", "disable perf software profilers").Default("false").Bool() + perfSwProfilerFlag = kingpin.Flag("collector.perf.software-profilers", "perf software profilers that should be collected").Strings() + perfNoCaProfiler = kingpin.Flag("collector.perf.disable-cache-profilers", "disable perf cache profilers").Default("false").Bool() + perfCaProfilerFlag = kingpin.Flag("collector.perf.cache-profilers", "perf cache profilers that should be collected").Strings() ) func init() { registerCollector(perfSubsystem, defaultDisabled, NewPerfCollector) } +var ( + perfHardwareProfilerMap = map[string]perf.HardwareProfilerType{ + "CpuCycles": perf.CpuCyclesProfiler, + "CpuInstr": perf.CpuInstrProfiler, + "CacheRef": perf.CacheRefProfiler, + "CacheMisses": perf.CacheMissesProfiler, + "BranchInstr": perf.BranchInstrProfiler, + "BranchMisses": perf.BranchMissesProfiler, + "StalledCyclesBackend": perf.StalledCyclesBackendProfiler, + "StalledCyclesFrontend": perf.StalledCyclesFrontendProfiler, + "RefCpuCycles": perf.RefCpuCyclesProfiler, + // "BusCycles": perf.BusCyclesProfiler, + } + perfSoftwareProfilerMap = map[string]perf.SoftwareProfilerType{ + "PageFault": perf.PageFaultProfiler, + "ContextSwitch": perf.ContextSwitchProfiler, + "CpuMigration": perf.CpuMigrationProfiler, + "MinorFault": perf.MinorFaultProfiler, + "MajorFault": perf.MajorFaultProfiler, + // "CpuClock": perf.CpuClockProfiler, + // "TaskClock": perf.TaskClockProfiler, + // "AlignFault": perf.AlignFaultProfiler, + // "EmuFault": perf.EmuFaultProfiler, + } + perfCacheProfilerMap = map[string]perf.CacheProfilerType{ + "L1DataReadHit": perf.L1DataReadHitProfiler, + "L1DataReadMiss": perf.L1DataReadMissProfiler, + "L1DataWriteHit": perf.L1DataWriteHitProfiler, + "L1InstrReadMiss": perf.L1InstrReadMissProfiler, + "LLReadHit": perf.LLReadHitProfiler, + "LLReadMiss": perf.LLReadMissProfiler, + "LLWriteHit": perf.LLWriteHitProfiler, + "LLWriteMiss": perf.LLWriteMissProfiler, + "InstrTLBReadHit": perf.InstrTLBReadHitProfiler, + "InstrTLBReadMiss": perf.InstrTLBReadMissProfiler, + "BPUReadHit": perf.BPUReadHitProfiler, + "BPUReadMiss": perf.BPUReadMissProfiler, + // "L1InstrReadHit": perf.L1InstrReadHitProfiler, + // "DataTLBReadHit": perf.DataTLBReadHitProfiler, + // "DataTLBReadMiss": perf.DataTLBReadMissProfiler, + // "DataTLBWriteHit": perf.DataTLBWriteHitProfiler, + // "DataTLBWriteMiss": perf.DataTLBWriteMissProfiler, + // "NodeCacheReadHit": perf.NodeCacheReadHitProfiler, + // "NodeCacheReadMiss": perf.NodeCacheReadMissProfiler, + // "NodeCacheWriteHit": perf.NodeCacheWriteHitProfiler, + // "NodeCacheWriteMiss": perf.NodeCacheWriteMissProfiler, + } +) + // perfTracepointFlagToTracepoints returns the set of configured tracepoints. func perfTracepointFlagToTracepoints(tracepointsFlag []string) ([]*perfTracepoint, error) { tracepoints := make([]*perfTracepoint, len(tracepointsFlag)) @@ -282,48 +337,82 @@ func NewPerfCollector(logger log.Logger) (Collector, error) { collector.tracepointCollector = tracepointCollector } + // Configure perf profilers + hardwareProfilers := perf.AllHardwareProfilers + if *perfHwProfilerFlag != nil && len(*perfHwProfilerFlag) > 0 { + // hardwareProfilers = 0 + for _, hf := range *perfHwProfilerFlag { + if v, ok := perfHardwareProfilerMap[hf]; ok { + hardwareProfilers |= v + } + } + } + softwareProfilers := perf.AllSoftwareProfilers + if *perfSwProfilerFlag != nil && len(*perfSwProfilerFlag) > 0 { + // softwareProfilers = 0 + for _, sf := range *perfSwProfilerFlag { + if v, ok := perfSoftwareProfilerMap[sf]; ok { + softwareProfilers |= v + } + } + } + cacheProfilers := perf.L1DataReadHitProfiler | perf.L1DataReadMissProfiler | perf.L1DataWriteHitProfiler | perf.L1InstrReadMissProfiler | perf.InstrTLBReadHitProfiler | perf.InstrTLBReadMissProfiler | perf.LLReadHitProfiler | perf.LLReadMissProfiler | perf.LLWriteHitProfiler | perf.LLWriteMissProfiler | perf.BPUReadHitProfiler | perf.BPUReadMissProfiler + if *perfCaProfilerFlag != nil && len(*perfCaProfilerFlag) > 0 { + cacheProfilers = 0 + for _, cf := range *perfCaProfilerFlag { + if v, ok := perfCacheProfilerMap[cf]; ok { + cacheProfilers |= v + } + } + } + // Configure all profilers for the specified CPUs. for _, cpu := range cpus { // Use -1 to profile all processes on the CPU, see: // man perf_event_open - hwProf, err := perf.NewHardwareProfiler( - -1, - cpu, - perf.AllHardwareProfilers, - ) - if err != nil && !hwProf.HasProfilers() { - return nil, err - } - if err := hwProf.Start(); err != nil { - return nil, err + if !*perfNoHwProfiler { + hwProf, err := perf.NewHardwareProfiler( + -1, + cpu, + hardwareProfilers, + ) + if err != nil && !hwProf.HasProfilers() { + return nil, err + } + if err := hwProf.Start(); err != nil { + return nil, err + } + collector.perfHwProfilers[cpu] = &hwProf + collector.hwProfilerCPUMap[&hwProf] = cpu } - collector.perfHwProfilers[cpu] = &hwProf - collector.hwProfilerCPUMap[&hwProf] = cpu - swProf, err := perf.NewSoftwareProfiler(-1, cpu, perf.AllSoftwareProfilers) - if err != nil && !swProf.HasProfilers() { - return nil, err - } - if err := swProf.Start(); err != nil { - return nil, err + if !*perfNoSwProfiler { + swProf, err := perf.NewSoftwareProfiler(-1, cpu, softwareProfilers) + if err != nil && !swProf.HasProfilers() { + return nil, err + } + if err := swProf.Start(); err != nil { + return nil, err + } + collector.perfSwProfilers[cpu] = &swProf + collector.swProfilerCPUMap[&swProf] = cpu } - collector.perfSwProfilers[cpu] = &swProf - collector.swProfilerCPUMap[&swProf] = cpu - cacheProfilers := perf.L1DataReadHitProfiler & perf.L1DataReadMissProfiler & perf.L1DataWriteHitProfiler & perf.L1InstrReadMissProfiler & perf.InstrTLBReadHitProfiler & perf.InstrTLBReadMissProfiler & perf.LLReadHitProfiler & perf.LLReadMissProfiler & perf.LLWriteHitProfiler & perf.LLWriteMissProfiler & perf.BPUReadHitProfiler & perf.BPUReadMissProfiler - cacheProf, err := perf.NewCacheProfiler( - -1, - cpu, - cacheProfilers, - ) - if err != nil && !cacheProf.HasProfilers() { - return nil, err - } - if err := cacheProf.Start(); err != nil { - return nil, err + if !*perfNoCaProfiler { + cacheProf, err := perf.NewCacheProfiler( + -1, + cpu, + cacheProfilers, + ) + if err != nil && !cacheProf.HasProfilers() { + return nil, err + } + if err := cacheProf.Start(); err != nil { + return nil, err + } + collector.perfCacheProfilers[cpu] = &cacheProf + collector.cacheProfilerCPUMap[&cacheProf] = cpu } - collector.perfCacheProfilers[cpu] = &cacheProf - collector.cacheProfilerCPUMap[&cacheProf] = cpu } collector.desc = map[string]*prometheus.Desc{ @@ -618,9 +707,6 @@ func (c *perfCollector) updateHardwareStats(ch chan<- prometheus.Metric) error { if err := (*profiler).Profile(hwProfile); err != nil { return err } - if hwProfile == nil { - continue - } cpuid := strconv.Itoa(c.hwProfilerCPUMap[profiler]) @@ -706,9 +792,6 @@ func (c *perfCollector) updateSoftwareStats(ch chan<- prometheus.Metric) error { if err := (*profiler).Profile(swProfile); err != nil { return err } - if swProfile == nil { - continue - } cpuid := strconv.Itoa(c.swProfilerCPUMap[profiler]) @@ -762,9 +845,6 @@ func (c *perfCollector) updateCacheStats(ch chan<- prometheus.Metric) error { if err := (*profiler).Profile(cacheProfile); err != nil { return err } - if cacheProfile == nil { - continue - } cpuid := strconv.Itoa(c.cacheProfilerCPUMap[profiler]) diff --git a/collector/perf_linux_test.go b/collector/perf_linux_test.go index bd2a591b93..fc557ffd32 100644 --- a/collector/perf_linux_test.go +++ b/collector/perf_linux_test.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !noprocesses -// +build !noprocesses +//go:build !noperf +// +build !noperf package collector @@ -24,7 +24,6 @@ import ( "testing" "github.com/go-kit/log" - "github.com/prometheus/client_golang/prometheus" ) @@ -54,7 +53,9 @@ func TestPerfCollector(t *testing.T) { metrics := make(chan prometheus.Metric) defer close(metrics) go func() { + i := 0 for range metrics { + i++ } }() if err := collector.Update(metrics); err != nil { diff --git a/collector/powersupplyclass.go b/collector/powersupplyclass.go index ffa4d4e61d..7f231dac47 100644 --- a/collector/powersupplyclass.go +++ b/collector/powersupplyclass.go @@ -20,9 +20,9 @@ package collector import ( "regexp" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) var ( diff --git a/collector/pressure_linux.go b/collector/pressure_linux.go index ceaced7eef..f64d004fa6 100644 --- a/collector/pressure_linux.go +++ b/collector/pressure_linux.go @@ -102,6 +102,14 @@ func (c *pressureStatsCollector) Update(ch chan<- prometheus.Metric) error { } return fmt.Errorf("failed to retrieve pressure stats: %w", err) } + if vals.Some == nil { + level.Debug(c.logger).Log("msg", "pressure information returned no 'some' data") + return ErrNoData + } + if vals.Full == nil && res != "cpu" { + level.Debug(c.logger).Log("msg", "pressure information returned no 'full' data") + return ErrNoData + } switch res { case "cpu": ch <- prometheus.MustNewConstMetric(c.cpu, prometheus.CounterValue, float64(vals.Some.Total)/1000.0/1000.0) diff --git a/collector/processes_linux_test.go b/collector/processes_linux_test.go index 9a5c86f5be..e2814a0104 100644 --- a/collector/processes_linux_test.go +++ b/collector/processes_linux_test.go @@ -19,9 +19,9 @@ package collector import ( "testing" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/procfs" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) func TestReadProcessStatus(t *testing.T) { diff --git a/collector/qdisc_linux.go b/collector/qdisc_linux.go index 5262e564dd..06ab6a88d6 100644 --- a/collector/qdisc_linux.go +++ b/collector/qdisc_linux.go @@ -22,10 +22,11 @@ import ( "os" "path/filepath" + "github.com/alecthomas/kingpin/v2" "github.com/ema/qdisc" "github.com/go-kit/log" + "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) type qdiscStatCollector struct { @@ -41,9 +42,11 @@ type qdiscStatCollector struct { } var ( - collectorQdisc = kingpin.Flag("collector.qdisc.fixtures", "test fixtures to use for qdisc collector end-to-end testing").Default("").String() - collectorQdiskDeviceInclude = kingpin.Flag("collector.qdisk.device-include", "Regexp of qdisk devices to include (mutually exclusive to device-exclude).").String() - collectorQdiskDeviceExclude = kingpin.Flag("collector.qdisk.device-exclude", "Regexp of qdisk devices to exclude (mutually exclusive to device-include).").String() + collectorQdisc = kingpin.Flag("collector.qdisc.fixtures", "test fixtures to use for qdisc collector end-to-end testing").Default("").String() + collectorQdiscDeviceInclude = kingpin.Flag("collector.qdisc.device-include", "Regexp of qdisc devices to include (mutually exclusive to device-exclude).").String() + oldCollectorQdiskDeviceInclude = kingpin.Flag("collector.qdisk.device-include", "DEPRECATED: Use collector.qdisc.device-include").Hidden().String() + collectorQdiscDeviceExclude = kingpin.Flag("collector.qdisc.device-exclude", "Regexp of qdisc devices to exclude (mutually exclusive to device-include).").String() + oldCollectorQdiskDeviceExclude = kingpin.Flag("collector.qdisk.device-exclude", "DEPRECATED: Use collector.qdisc.device-exclude").Hidden().String() ) func init() { @@ -52,8 +55,26 @@ func init() { // NewQdiscStatCollector returns a new Collector exposing queuing discipline statistics. func NewQdiscStatCollector(logger log.Logger) (Collector, error) { - if *collectorQdiskDeviceExclude != "" && *collectorQdiskDeviceInclude != "" { - return nil, fmt.Errorf("collector.qdisk.device-include and collector.qdisk.device-exclude are mutaly exclusive") + if *oldCollectorQdiskDeviceInclude != "" { + if *collectorQdiscDeviceInclude == "" { + level.Warn(logger).Log("msg", "--collector.qdisk.device-include is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-include") + *collectorQdiscDeviceInclude = *oldCollectorQdiskDeviceInclude + } else { + return nil, fmt.Errorf("--collector.qdisk.device-include and --collector.qdisc.device-include are mutually exclusive") + } + } + + if *oldCollectorQdiskDeviceExclude != "" { + if *collectorQdiscDeviceExclude == "" { + level.Warn(logger).Log("msg", "--collector.qdisk.device-exclude is DEPRECATED and will be removed in 2.0.0, use --collector.qdisc.device-exclude") + *collectorQdiscDeviceExclude = *oldCollectorQdiskDeviceExclude + } else { + return nil, fmt.Errorf("--collector.qdisk.device-exclude and --collector.qdisc.device-exclude are mutually exclusive") + } + } + + if *collectorQdiscDeviceExclude != "" && *collectorQdiscDeviceInclude != "" { + return nil, fmt.Errorf("collector.qdisc.device-include and collector.qdisc.device-exclude are mutaly exclusive") } return &qdiscStatCollector{ @@ -93,7 +114,7 @@ func NewQdiscStatCollector(logger log.Logger) (Collector, error) { []string{"device", "kind"}, nil, ), prometheus.GaugeValue}, logger: logger, - deviceFilter: newDeviceFilter(*collectorQdiskDeviceExclude, *collectorQdiskDeviceExclude), + deviceFilter: newDeviceFilter(*collectorQdiscDeviceExclude, *collectorQdiscDeviceInclude), }, nil } diff --git a/collector/rapl_linux.go b/collector/rapl_linux.go index f6f7dfc795..642de6c146 100644 --- a/collector/rapl_linux.go +++ b/collector/rapl_linux.go @@ -22,11 +22,11 @@ import ( "os" "strconv" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" - "gopkg.in/alecthomas/kingpin.v2" ) const raplCollectorSubsystem = "rapl" diff --git a/collector/runit.go b/collector/runit.go index 2449691dbb..3cae657c33 100644 --- a/collector/runit.go +++ b/collector/runit.go @@ -17,11 +17,11 @@ package collector import ( + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" + "github.com/prometheus-community/go-runit/runit" "github.com/prometheus/client_golang/prometheus" - "github.com/soundcloud/go-runit/runit" - "gopkg.in/alecthomas/kingpin.v2" ) var runitServiceDir = kingpin.Flag("collector.runit.servicedir", "Path to runit service directory.").Default("/etc/service").String() @@ -46,6 +46,8 @@ func NewRunitCollector(logger log.Logger) (Collector, error) { labelNames = []string{"service"} ) + level.Warn(logger).Log("msg", "This collector is deprecated and will be removed in the next major version release.") + return &runitCollector{ state: typedDesc{prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "state"), diff --git a/collector/selinux_linux.go b/collector/selinux_linux.go index 71a3c02170..79316362fe 100644 --- a/collector/selinux_linux.go +++ b/collector/selinux_linux.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !noselinux -// +build linux,!noselinux +//go:build !noselinux +// +build !noselinux package collector diff --git a/collector/slabinfo_linux.go b/collector/slabinfo_linux.go index 8c032cbbdf..a3c3ebced7 100644 --- a/collector/slabinfo_linux.go +++ b/collector/slabinfo_linux.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !noslabinfo -// +build linux,!noslabinfo +//go:build !noslabinfo +// +build !noslabinfo package collector diff --git a/collector/softirq_linux.go b/collector/softirq_linux.go new file mode 100644 index 0000000000..702f34bb0c --- /dev/null +++ b/collector/softirq_linux.go @@ -0,0 +1,68 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !nosoftirqs +// +build !nosoftirqs + +package collector + +import ( + "fmt" + "strconv" + + "github.com/prometheus/client_golang/prometheus" +) + +var ( + softirqLabelNames = []string{"cpu", "type"} +) + +func (c *softirqsCollector) Update(ch chan<- prometheus.Metric) (err error) { + softirqs, err := c.fs.Softirqs() + if err != nil { + return fmt.Errorf("couldn't get softirqs: %w", err) + } + + for cpuNo, value := range softirqs.Hi { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "HI") + } + for cpuNo, value := range softirqs.Timer { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "TIMER") + } + for cpuNo, value := range softirqs.NetTx { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "NET_TX") + } + for cpuNo, value := range softirqs.NetRx { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "NET_RX") + } + for cpuNo, value := range softirqs.Block { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "BLOCK") + } + for cpuNo, value := range softirqs.IRQPoll { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "IRQ_POLL") + } + for cpuNo, value := range softirqs.Tasklet { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "TASKLET") + } + for cpuNo, value := range softirqs.Sched { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "SCHED") + } + for cpuNo, value := range softirqs.HRTimer { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "HRTIMER") + } + for cpuNo, value := range softirqs.RCU { + ch <- c.desc.mustNewConstMetric(float64(value), strconv.Itoa(cpuNo), "RCU") + } + + return err +} diff --git a/collector/softirqs_common.go b/collector/softirqs_common.go new file mode 100644 index 0000000000..08ef780f26 --- /dev/null +++ b/collector/softirqs_common.go @@ -0,0 +1,50 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux && !nosoftirqs +// +build linux,!nosoftirqs + +package collector + +import ( + "fmt" + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs" +) + +type softirqsCollector struct { + fs procfs.FS + desc typedDesc + logger log.Logger +} + +func init() { + registerCollector("softirqs", defaultDisabled, NewSoftirqsCollector) +} + +// NewSoftirqsCollector returns a new Collector exposing softirq stats. +func NewSoftirqsCollector(logger log.Logger) (Collector, error) { + desc := typedDesc{prometheus.NewDesc( + namespace+"_softirqs_functions_total", + "Softirq counts per CPU.", + softirqLabelNames, nil, + ), prometheus.CounterValue} + + fs, err := procfs.NewFS(*procPath) + if err != nil { + return nil, fmt.Errorf("failed to open procfs: %w", err) + } + + return &softirqsCollector{fs, desc, logger}, nil +} diff --git a/collector/softnet_linux.go b/collector/softnet_linux.go index a46b6808be..42d47780e3 100644 --- a/collector/softnet_linux.go +++ b/collector/softnet_linux.go @@ -26,11 +26,15 @@ import ( ) type softnetCollector struct { - fs procfs.FS - processed *prometheus.Desc - dropped *prometheus.Desc - timeSqueezed *prometheus.Desc - logger log.Logger + fs procfs.FS + processed *prometheus.Desc + dropped *prometheus.Desc + timeSqueezed *prometheus.Desc + cpuCollision *prometheus.Desc + receivedRps *prometheus.Desc + flowLimitCount *prometheus.Desc + softnetBacklogLen *prometheus.Desc + logger log.Logger } const ( @@ -65,19 +69,41 @@ func NewSoftnetCollector(logger log.Logger) (Collector, error) { "Number of times processing packets ran out of quota", []string{"cpu"}, nil, ), + cpuCollision: prometheus.NewDesc( + prometheus.BuildFQName(namespace, softnetSubsystem, "cpu_collision_total"), + "Number of collision occur while obtaining device lock while transmitting", + []string{"cpu"}, nil, + ), + receivedRps: prometheus.NewDesc( + prometheus.BuildFQName(namespace, softnetSubsystem, "received_rps_total"), + "Number of times cpu woken up received_rps", + []string{"cpu"}, nil, + ), + flowLimitCount: prometheus.NewDesc( + prometheus.BuildFQName(namespace, softnetSubsystem, "flow_limit_count_total"), + "Number of times flow limit has been reached", + []string{"cpu"}, nil, + ), + softnetBacklogLen: prometheus.NewDesc( + prometheus.BuildFQName(namespace, softnetSubsystem, "backlog_len"), + "Softnet backlog status", + []string{"cpu"}, nil, + ), logger: logger, }, nil } // Update gets parsed softnet statistics using procfs. func (c *softnetCollector) Update(ch chan<- prometheus.Metric) error { + var cpu string + stats, err := c.fs.NetSoftnetStat() if err != nil { return fmt.Errorf("could not get softnet statistics: %w", err) } - for cpuNumber, cpuStats := range stats { - cpu := strconv.Itoa(cpuNumber) + for _, cpuStats := range stats { + cpu = strconv.FormatUint(uint64(cpuStats.Index), 10) ch <- prometheus.MustNewConstMetric( c.processed, @@ -97,6 +123,30 @@ func (c *softnetCollector) Update(ch chan<- prometheus.Metric) error { float64(cpuStats.TimeSqueezed), cpu, ) + ch <- prometheus.MustNewConstMetric( + c.cpuCollision, + prometheus.CounterValue, + float64(cpuStats.CPUCollision), + cpu, + ) + ch <- prometheus.MustNewConstMetric( + c.receivedRps, + prometheus.CounterValue, + float64(cpuStats.ReceivedRps), + cpu, + ) + ch <- prometheus.MustNewConstMetric( + c.flowLimitCount, + prometheus.CounterValue, + float64(cpuStats.FlowLimitCount), + cpu, + ) + ch <- prometheus.MustNewConstMetric( + c.softnetBacklogLen, + prometheus.GaugeValue, + float64(cpuStats.SoftnetBacklogLen), + cpu, + ) } return nil diff --git a/collector/stat_linux.go b/collector/stat_linux.go index 83ad2b6de8..9974ae7aa7 100644 --- a/collector/stat_linux.go +++ b/collector/stat_linux.go @@ -19,10 +19,10 @@ package collector import ( "fmt" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" - "gopkg.in/alecthomas/kingpin.v2" ) type statCollector struct { diff --git a/collector/supervisord.go b/collector/supervisord.go index a090068c30..8dc2e78e3c 100644 --- a/collector/supervisord.go +++ b/collector/supervisord.go @@ -24,11 +24,11 @@ import ( "net/url" "time" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" xmlrpc "github.com/mattn/go-xmlrpc" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) var ( @@ -69,6 +69,8 @@ func NewSupervisordCollector(logger log.Logger) (Collector, error) { xrpc = xmlrpc.NewClient(*supervisordURL) } + level.Warn(logger).Log("msg", "This collector is deprecated and will be removed in the next major version release.") + return &supervisordCollector{ upDesc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "up"), diff --git a/collector/sysctl_linux.go b/collector/sysctl_linux.go index 4b0d105333..c14341db85 100644 --- a/collector/sysctl_linux.go +++ b/collector/sysctl_linux.go @@ -18,10 +18,10 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs" - "gopkg.in/alecthomas/kingpin.v2" ) var ( diff --git a/collector/systemd_linux.go b/collector/systemd_linux.go index c81a3fa7ca..e0d35bcde6 100644 --- a/collector/systemd_linux.go +++ b/collector/systemd_linux.go @@ -27,11 +27,11 @@ import ( "sync" "time" + "github.com/alecthomas/kingpin/v2" "github.com/coreos/go-systemd/v22/dbus" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) const ( @@ -42,18 +42,18 @@ const ( ) var ( - unitIncludeSet bool - unitInclude = kingpin.Flag("collector.systemd.unit-include", "Regexp of systemd units to include. Units must both match include and not match exclude to be included.").Default(".+").PreAction(func(c *kingpin.ParseContext) error { - unitIncludeSet = true + systemdUnitIncludeSet bool + systemdUnitInclude = kingpin.Flag("collector.systemd.unit-include", "Regexp of systemd units to include. Units must both match include and not match exclude to be included.").Default(".+").PreAction(func(c *kingpin.ParseContext) error { + systemdUnitIncludeSet = true return nil }).String() - oldUnitInclude = kingpin.Flag("collector.systemd.unit-whitelist", "DEPRECATED: Use --collector.systemd.unit-include").Hidden().String() - unitExcludeSet bool - unitExclude = kingpin.Flag("collector.systemd.unit-exclude", "Regexp of systemd units to exclude. Units must both match include and not match exclude to be included.").Default(".+\\.(automount|device|mount|scope|slice)").PreAction(func(c *kingpin.ParseContext) error { - unitExcludeSet = true + oldSystemdUnitInclude = kingpin.Flag("collector.systemd.unit-whitelist", "DEPRECATED: Use --collector.systemd.unit-include").Hidden().String() + systemdUnitExcludeSet bool + systemdUnitExclude = kingpin.Flag("collector.systemd.unit-exclude", "Regexp of systemd units to exclude. Units must both match include and not match exclude to be included.").Default(".+\\.(automount|device|mount|scope|slice)").PreAction(func(c *kingpin.ParseContext) error { + systemdUnitExcludeSet = true return nil }).String() - oldUnitExclude = kingpin.Flag("collector.systemd.unit-blacklist", "DEPRECATED: Use collector.systemd.unit-exclude").Hidden().String() + oldSystemdUnitExclude = kingpin.Flag("collector.systemd.unit-blacklist", "DEPRECATED: Use collector.systemd.unit-exclude").Hidden().String() systemdPrivate = kingpin.Flag("collector.systemd.private", "Establish a private, direct connection to systemd without dbus (Strongly discouraged since it requires root. For testing purposes only).").Hidden().Bool() enableTaskMetrics = kingpin.Flag("collector.systemd.enable-task-metrics", "Enables service unit tasks metrics unit_tasks_current and unit_tasks_max").Bool() enableRestartsMetrics = kingpin.Flag("collector.systemd.enable-restarts-metrics", "Enables service unit metric service_restart_total").Bool() @@ -75,9 +75,10 @@ type systemdCollector struct { socketCurrentConnectionsDesc *prometheus.Desc socketRefusedConnectionsDesc *prometheus.Desc systemdVersionDesc *prometheus.Desc - unitIncludePattern *regexp.Regexp - unitExcludePattern *regexp.Regexp - logger log.Logger + // Use regexps for more flexibility than device_filter.go allows + systemdUnitIncludePattern *regexp.Regexp + systemdUnitExcludePattern *regexp.Regexp + logger log.Logger } var unitStatesName = []string{"active", "activating", "deactivating", "inactive", "failed"} @@ -133,26 +134,26 @@ func NewSystemdCollector(logger log.Logger) (Collector, error) { prometheus.BuildFQName(namespace, subsystem, "version"), "Detected systemd version", []string{"version"}, nil) - if *oldUnitExclude != "" { - if !unitExcludeSet { + if *oldSystemdUnitExclude != "" { + if !systemdUnitExcludeSet { level.Warn(logger).Log("msg", "--collector.systemd.unit-blacklist is DEPRECATED and will be removed in 2.0.0, use --collector.systemd.unit-exclude") - *unitExclude = *oldUnitExclude + *systemdUnitExclude = *oldSystemdUnitExclude } else { return nil, errors.New("--collector.systemd.unit-blacklist and --collector.systemd.unit-exclude are mutually exclusive") } } - if *oldUnitInclude != "" { - if !unitIncludeSet { + if *oldSystemdUnitInclude != "" { + if !systemdUnitIncludeSet { level.Warn(logger).Log("msg", "--collector.systemd.unit-whitelist is DEPRECATED and will be removed in 2.0.0, use --collector.systemd.unit-include") - *unitInclude = *oldUnitInclude + *systemdUnitInclude = *oldSystemdUnitInclude } else { return nil, errors.New("--collector.systemd.unit-whitelist and --collector.systemd.unit-include are mutually exclusive") } } - level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-include", "flag", *unitInclude) - unitIncludePattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitInclude)) - level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-exclude", "flag", *unitExclude) - unitExcludePattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *unitExclude)) + level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-include", "flag", *systemdUnitInclude) + systemdUnitIncludePattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *systemdUnitInclude)) + level.Info(logger).Log("msg", "Parsed flag --collector.systemd.unit-exclude", "flag", *systemdUnitExclude) + systemdUnitExcludePattern := regexp.MustCompile(fmt.Sprintf("^(?:%s)$", *systemdUnitExclude)) return &systemdCollector{ unitDesc: unitDesc, @@ -167,8 +168,8 @@ func NewSystemdCollector(logger log.Logger) (Collector, error) { socketCurrentConnectionsDesc: socketCurrentConnectionsDesc, socketRefusedConnectionsDesc: socketRefusedConnectionsDesc, systemdVersionDesc: systemdVersionDesc, - unitIncludePattern: unitIncludePattern, - unitExcludePattern: unitExcludePattern, + systemdUnitIncludePattern: systemdUnitIncludePattern, + systemdUnitExcludePattern: systemdUnitExcludePattern, logger: logger, }, nil } @@ -206,7 +207,7 @@ func (c *systemdCollector) Update(ch chan<- prometheus.Metric) error { level.Debug(c.logger).Log("msg", "collectSummaryMetrics took", "duration_seconds", time.Since(begin).Seconds()) begin = time.Now() - units := filterUnits(allUnits, c.unitIncludePattern, c.unitExcludePattern, c.logger) + units := filterUnits(allUnits, c.systemdUnitIncludePattern, c.systemdUnitExcludePattern, c.logger) level.Debug(c.logger).Log("msg", "filterUnits took", "duration_seconds", time.Since(begin).Seconds()) var wg sync.WaitGroup @@ -334,9 +335,7 @@ func (c *systemdCollector) collectSockets(conn *dbus.Conn, ch chan<- prometheus. // NRefused wasn't added until systemd 239. refusedConnectionCount, err := conn.GetUnitTypePropertyContext(context.TODO(), unit.Name, "Socket", "NRefused") - if err != nil { - //log.Debugf("couldn't get unit '%s' NRefused: %s", unit.Name, err) - } else { + if err == nil { ch <- prometheus.MustNewConstMetric( c.socketRefusedConnectionsDesc, prometheus.GaugeValue, float64(refusedConnectionCount.Value.Value().(uint32)), unit.Name) diff --git a/collector/systemd_linux_test.go b/collector/systemd_linux_test.go index 1905f5d992..d4e300d1d2 100644 --- a/collector/systemd_linux_test.go +++ b/collector/systemd_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !nosystemd +// +build !nosystemd + package collector import ( @@ -106,7 +109,7 @@ func TestSystemdIgnoreFilterDefaultKeepsAll(t *testing.T) { } fixtures := getUnitListFixtures() collector := c.(*systemdCollector) - filtered := filterUnits(fixtures[0], collector.unitIncludePattern, collector.unitExcludePattern, logger) + filtered := filterUnits(fixtures[0], collector.systemdUnitIncludePattern, collector.systemdUnitExcludePattern, logger) // Adjust fixtures by 3 "not-found" units. if len(filtered) != len(fixtures[0])-3 { t.Error("Default filters removed units") diff --git a/collector/tapestats_linux.go b/collector/tapestats_linux.go index 441ac61073..264c2210f1 100644 --- a/collector/tapestats_linux.go +++ b/collector/tapestats_linux.go @@ -21,11 +21,11 @@ import ( "os" "regexp" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" - "gopkg.in/alecthomas/kingpin.v2" ) var ( diff --git a/collector/tcpstat_linux_test.go b/collector/tcpstat_linux_test.go index 37dc1eeef0..e1bd090a79 100644 --- a/collector/tcpstat_linux_test.go +++ b/collector/tcpstat_linux_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !notcpstat +// +build !notcpstat + package collector import ( @@ -19,13 +22,14 @@ import ( "syscall" "testing" + "github.com/josharian/native" "github.com/mdlayher/netlink" ) func Test_parseTCPStats(t *testing.T) { encode := func(m InetDiagMsg) []byte { var buf bytes.Buffer - err := binary.Write(&buf, binary.LittleEndian, m) + err := binary.Write(&buf, native.Endian, m) if err != nil { panic(err) } diff --git a/collector/textfile.go b/collector/textfile.go index 5bdda3b698..4f1fd0b8c7 100644 --- a/collector/textfile.go +++ b/collector/textfile.go @@ -24,12 +24,12 @@ import ( "strings" "time" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( @@ -193,6 +193,7 @@ func (c *textFileCollector) Update(ch chan<- prometheus.Metric) error { var errored bool var parsedFamilies []*dto.MetricFamily metricsNamesToFiles := map[string][]string{} + metricsNamesToHelpTexts := map[string][2]string{} paths, err := filepath.Glob(c.path) if err != nil || len(paths) == 0 { @@ -218,6 +219,23 @@ func (c *textFileCollector) Update(ch chan<- prometheus.Metric) error { mtime, families, err := c.processFile(path, f.Name(), ch) for _, mf := range families { + // Check for metrics with inconsistent help texts and take the first help text occurrence. + if helpTexts, seen := metricsNamesToHelpTexts[*mf.Name]; seen { + if mf.Help != nil && helpTexts[0] != *mf.Help || helpTexts[1] != "" { + metricsNamesToHelpTexts[*mf.Name] = [2]string{helpTexts[0], *mf.Help} + errored = true + level.Error(c.logger).Log("msg", "inconsistent metric help text", + "metric", *mf.Name, + "original_help_text", helpTexts[0], + "new_help_text", *mf.Help, + // Only the first file path will be recorded in case of two or more inconsistent help texts. + "file", metricsNamesToFiles[*mf.Name][0]) + continue + } + } + if mf.Help != nil { + metricsNamesToHelpTexts[*mf.Name] = [2]string{*mf.Help} + } metricsNamesToFiles[*mf.Name] = append(metricsNamesToFiles[*mf.Name], metricsFilePath) parsedFamilies = append(parsedFamilies, mf) } diff --git a/collector/textfile_test.go b/collector/textfile_test.go index 8ec2584756..95e5966f3e 100644 --- a/collector/textfile_test.go +++ b/collector/textfile_test.go @@ -11,6 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !notextfile +// +build !notextfile + package collector import ( @@ -20,12 +23,12 @@ import ( "os" "testing" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/promlog" "github.com/prometheus/common/promlog/flag" - "gopkg.in/alecthomas/kingpin.v2" ) type collectorAdapter struct { diff --git a/collector/thermal_zone_linux.go b/collector/thermal_zone_linux.go index 6aedf34796..6eff27321a 100644 --- a/collector/thermal_zone_linux.go +++ b/collector/thermal_zone_linux.go @@ -17,9 +17,12 @@ package collector import ( + "errors" "fmt" + "os" "github.com/go-kit/log" + "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/procfs/sysfs" ) @@ -70,6 +73,10 @@ func NewThermalZoneCollector(logger log.Logger) (Collector, error) { func (c *thermalZoneCollector) Update(ch chan<- prometheus.Metric) error { thermalZones, err := c.fs.ClassThermalZoneStats() if err != nil { + if errors.Is(err, os.ErrNotExist) || errors.Is(err, os.ErrPermission) || errors.Is(err, os.ErrInvalid) { + level.Debug(c.logger).Log("msg", "Could not read thermal zone stats", "err", err) + return ErrNoData + } return err } diff --git a/collector/time_linux.go b/collector/time_linux.go index a67f5a8f27..dd4afe7592 100644 --- a/collector/time_linux.go +++ b/collector/time_linux.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !notime -// +build linux,!notime +//go:build !notime +// +build !notime package collector diff --git a/collector/timex.go b/collector/timex.go index c444d3ea14..69cbc1a1d0 100644 --- a/collector/timex.go +++ b/collector/timex.go @@ -38,6 +38,9 @@ const ( // 1 second in nanoSeconds = 1000000000 microSeconds = 1000000 + + // See NOTES in adjtimex(2). + ppm16frac = 1000000.0 * 65536.0 ) type timexCollector struct { @@ -183,8 +186,6 @@ func (c *timexCollector) Update(ch chan<- prometheus.Metric) error { } else { divisor = microSeconds } - // See NOTES in adjtimex(2). - const ppm16frac = 1000000.0 * 65536.0 ch <- c.syncStatus.mustNewConstMetric(syncStatus) ch <- c.offset.mustNewConstMetric(float64(timex.Offset) / divisor) diff --git a/collector/uname.go b/collector/uname.go index 14cfefb324..76e66b7e33 100644 --- a/collector/uname.go +++ b/collector/uname.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build (darwin || freebsd || openbsd || linux) && !nouname -// +build darwin freebsd openbsd linux +//go:build (darwin || freebsd || openbsd || netbsd || linux) && !nouname +// +build darwin freebsd openbsd netbsd linux // +build !nouname package collector diff --git a/collector/uname_bsd.go b/collector/uname_bsd.go index 736b3d1246..69bf38e910 100644 --- a/collector/uname_bsd.go +++ b/collector/uname_bsd.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build (darwin || freebsd || openbsd) && !nouname -// +build darwin freebsd openbsd +//go:build (darwin || freebsd || openbsd || netbsd) && !nouname +// +build darwin freebsd openbsd netbsd // +build !nouname package collector diff --git a/collector/vmstat_linux.go b/collector/vmstat_linux.go index a59916573b..cde2df5da5 100644 --- a/collector/vmstat_linux.go +++ b/collector/vmstat_linux.go @@ -24,9 +24,9 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) const ( diff --git a/collector/watchdog.go b/collector/watchdog.go new file mode 100644 index 0000000000..01351be9b5 --- /dev/null +++ b/collector/watchdog.go @@ -0,0 +1,140 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux && !nowatchdog +// +build linux,!nowatchdog + +package collector + +import ( + "errors" + "fmt" + "os" + + "github.com/go-kit/log" + "github.com/go-kit/log/level" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs/sysfs" +) + +type watchdogCollector struct { + fs sysfs.FS + logger log.Logger +} + +func init() { + registerCollector("watchdog", defaultEnabled, NewWatchdogCollector) +} + +// NewWatchdogCollector returns a new Collector exposing watchdog stats. +func NewWatchdogCollector(logger log.Logger) (Collector, error) { + fs, err := sysfs.NewFS(*sysPath) + if err != nil { + return nil, fmt.Errorf("failed to open procfs: %w", err) + } + + return &watchdogCollector{ + fs: fs, + logger: logger, + }, nil +} + +var ( + watchdogBootstatusDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "bootstatus"), + "Value of /sys/class/watchdog//bootstatus", + []string{"name"}, nil, + ) + watchdogFwVersionDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "fw_version"), + "Value of /sys/class/watchdog//fw_version", + []string{"name"}, nil, + ) + watchdogNowayoutDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "nowayout"), + "Value of /sys/class/watchdog//nowayout", + []string{"name"}, nil, + ) + watchdogTimeleftDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "timeleft_seconds"), + "Value of /sys/class/watchdog//timeleft", + []string{"name"}, nil, + ) + watchdogTimeoutDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "timeout_seconds"), + "Value of /sys/class/watchdog//timeout", + []string{"name"}, nil, + ) + watchdogPretimeoutDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "pretimeout_seconds"), + "Value of /sys/class/watchdog//pretimeout", + []string{"name"}, nil, + ) + watchdogAccessCs0Desc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "access_cs0"), + "Value of /sys/class/watchdog//access_cs0", + []string{"name"}, nil, + ) + watchdogInfoDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "watchdog", "info"), + "Info of /sys/class/watchdog/", + []string{"name", "options", "identity", "state", "status", "pretimeout_governor"}, nil, + ) +) + +func toLabelValue(ptr *string) string { + if ptr == nil { + return "" + } + return *ptr +} + +func (c *watchdogCollector) Update(ch chan<- prometheus.Metric) error { + watchdogClass, err := c.fs.WatchdogClass() + if err != nil { + if errors.Is(err, os.ErrNotExist) || errors.Is(err, os.ErrPermission) || errors.Is(err, os.ErrInvalid) { + level.Debug(c.logger).Log("msg", "Could not read watchdog stats", "err", err) + return ErrNoData + } + return err + } + + for _, wd := range watchdogClass { + if wd.Bootstatus != nil { + ch <- prometheus.MustNewConstMetric(watchdogBootstatusDesc, prometheus.GaugeValue, float64(*wd.Bootstatus), wd.Name) + } + if wd.FwVersion != nil { + ch <- prometheus.MustNewConstMetric(watchdogFwVersionDesc, prometheus.GaugeValue, float64(*wd.FwVersion), wd.Name) + } + if wd.Nowayout != nil { + ch <- prometheus.MustNewConstMetric(watchdogNowayoutDesc, prometheus.GaugeValue, float64(*wd.Nowayout), wd.Name) + } + if wd.Timeleft != nil { + ch <- prometheus.MustNewConstMetric(watchdogTimeleftDesc, prometheus.GaugeValue, float64(*wd.Timeleft), wd.Name) + } + if wd.Timeout != nil { + ch <- prometheus.MustNewConstMetric(watchdogTimeoutDesc, prometheus.GaugeValue, float64(*wd.Timeout), wd.Name) + } + if wd.Pretimeout != nil { + ch <- prometheus.MustNewConstMetric(watchdogPretimeoutDesc, prometheus.GaugeValue, float64(*wd.Pretimeout), wd.Name) + } + if wd.AccessCs0 != nil { + ch <- prometheus.MustNewConstMetric(watchdogAccessCs0Desc, prometheus.GaugeValue, float64(*wd.AccessCs0), wd.Name) + } + + ch <- prometheus.MustNewConstMetric(watchdogInfoDesc, prometheus.GaugeValue, 1.0, + wd.Name, toLabelValue(wd.Options), toLabelValue(wd.Identity), toLabelValue(wd.State), toLabelValue(wd.Status), toLabelValue(wd.PretimeoutGovernor)) + } + + return nil +} diff --git a/collector/watchdog_test.go b/collector/watchdog_test.go new file mode 100644 index 0000000000..e59382b4c9 --- /dev/null +++ b/collector/watchdog_test.go @@ -0,0 +1,92 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file ewcept in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux && !nowatchdog +// +build linux,!nowatchdog + +package collector + +import ( + "fmt" + "os" + "strings" + "testing" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" +) + +type testWatchdogCollector struct { + wc Collector +} + +func (c testWatchdogCollector) Collect(ch chan<- prometheus.Metric) { + c.wc.Update(ch) +} + +func (c testWatchdogCollector) Describe(ch chan<- *prometheus.Desc) { + prometheus.DescribeByCollect(c, ch) +} + +func TestWatchdogStats(t *testing.T) { + testcase := `# HELP node_watchdog_access_cs0 Value of /sys/class/watchdog//access_cs0 + # TYPE node_watchdog_access_cs0 gauge + node_watchdog_access_cs0{name="watchdog0"} 0 + # HELP node_watchdog_bootstatus Value of /sys/class/watchdog//bootstatus + # TYPE node_watchdog_bootstatus gauge + node_watchdog_bootstatus{name="watchdog0"} 1 + # HELP node_watchdog_fw_version Value of /sys/class/watchdog//fw_version + # TYPE node_watchdog_fw_version gauge + node_watchdog_fw_version{name="watchdog0"} 2 + # HELP node_watchdog_info Info of /sys/class/watchdog/ + # TYPE node_watchdog_info gauge + node_watchdog_info{identity="",name="watchdog1",options="",pretimeout_governor="",state="",status=""} 1 + node_watchdog_info{identity="Software Watchdog",name="watchdog0",options="0x8380",pretimeout_governor="noop",state="active",status="0x8000"} 1 + # HELP node_watchdog_nowayout Value of /sys/class/watchdog//nowayout + # TYPE node_watchdog_nowayout gauge + node_watchdog_nowayout{name="watchdog0"} 0 + # HELP node_watchdog_pretimeout_seconds Value of /sys/class/watchdog//pretimeout + # TYPE node_watchdog_pretimeout_seconds gauge + node_watchdog_pretimeout_seconds{name="watchdog0"} 120 + # HELP node_watchdog_timeleft_seconds Value of /sys/class/watchdog//timeleft + # TYPE node_watchdog_timeleft_seconds gauge + node_watchdog_timeleft_seconds{name="watchdog0"} 300 + # HELP node_watchdog_timeout_seconds Value of /sys/class/watchdog//timeout + # TYPE node_watchdog_timeout_seconds gauge + node_watchdog_timeout_seconds{name="watchdog0"} 60 + ` + *sysPath = "fixtures/sys" + + logger := log.NewLogfmtLogger(os.Stderr) + c, err := NewWatchdogCollector(logger) + if err != nil { + t.Fatal(err) + } + reg := prometheus.NewRegistry() + reg.MustRegister(&testWatchdogCollector{wc: c}) + + sink := make(chan prometheus.Metric) + go func() { + err = c.Update(sink) + if err != nil { + panic(fmt.Errorf("failed to update collector: %s", err)) + } + close(sink) + }() + + err = testutil.GatherAndCompare(reg, strings.NewReader(testcase)) + if err != nil { + t.Fatal(err) + } +} diff --git a/collector/wifi_linux.go b/collector/wifi_linux.go index d8f5883852..aff8eb2d36 100644 --- a/collector/wifi_linux.go +++ b/collector/wifi_linux.go @@ -23,11 +23,11 @@ import ( "os" "path/filepath" + "github.com/alecthomas/kingpin/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/mdlayher/wifi" "github.com/prometheus/client_golang/prometheus" - "gopkg.in/alecthomas/kingpin.v2" ) type wifiCollector struct { diff --git a/collector/xfrm.go b/collector/xfrm.go new file mode 100644 index 0000000000..cbdcc97f1f --- /dev/null +++ b/collector/xfrm.go @@ -0,0 +1,228 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !noxfrm +// +build !noxfrm + +package collector + +import ( + "fmt" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/procfs" +) + +type xfrmCollector struct { + fs procfs.FS + logger log.Logger +} + +func init() { + registerCollector("xfrm", defaultDisabled, NewXfrmCollector) +} + +// NewXfrmCollector returns a new Collector exposing XFRM stats. +func NewXfrmCollector(logger log.Logger) (Collector, error) { + fs, err := procfs.NewFS(*procPath) + if err != nil { + return nil, fmt.Errorf("failed to open procfs: %w", err) + } + + return &xfrmCollector{ + fs: fs, + logger: logger, + }, nil +} + +var ( + xfrmInErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_error_packets_total"), + "All errors not matched by other", + nil, nil, + ) + xfrmInBufferErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_buffer_error_packets_total"), + "No buffer is left", + nil, nil, + ) + xfrmInHdrErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_hdr_error_packets_total"), + "Header error", + nil, nil, + ) + xfrmInNoStatesDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_no_states_packets_total"), + "No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong", + nil, nil, + ) + xfrmInStateProtoErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_proto_error_packets_total"), + "Transformation protocol specific error e.g. SA key is wrong", + nil, nil, + ) + xfrmInStateModeErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_mode_error_packets_total"), + "Transformation mode specific error", + nil, nil, + ) + xfrmInStateSeqErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_seq_error_packets_total"), + "Sequence error i.e. Sequence number is out of window", + nil, nil, + ) + xfrmInStateExpiredDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_expired_packets_total"), + "State is expired", + nil, nil, + ) + xfrmInStateMismatchDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_mismatch_packets_total"), + "State has mismatch option e.g. UDP encapsulation type is mismatch", + nil, nil, + ) + xfrmInStateInvalidDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_state_invalid_packets_total"), + "State is invalid", + nil, nil, + ) + xfrmInTmplMismatchDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_tmpl_mismatch_packets_total"), + "No matching template for states e.g. Inbound SAs are correct but SP rule is wrong", + nil, nil, + ) + xfrmInNoPolsDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_no_pols_packets_total"), + "No policy is found for states e.g. Inbound SAs are correct but no SP is found", + nil, nil, + ) + xfrmInPolBlockDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_pol_block_packets_total"), + "Policy discards", + nil, nil, + ) + xfrmInPolErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "in_pol_error_packets_total"), + "Policy error", + nil, nil, + ) + xfrmOutErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_error_packets_total"), + "All errors which is not matched others", + nil, nil, + ) + xfrmOutBundleGenErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_bundle_gen_error_packets_total"), + "Bundle generation error", + nil, nil, + ) + xfrmOutBundleCheckErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_bundle_check_error_packets_total"), + "Bundle check error", + nil, nil, + ) + xfrmOutNoStatesDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_no_states_packets_total"), + "No state is found", + nil, nil, + ) + xfrmOutStateProtoErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_state_proto_error_packets_total"), + "Transformation protocol specific error", + nil, nil, + ) + xfrmOutStateModeErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_state_mode_error_packets_total"), + "Transformation mode specific error", + nil, nil, + ) + xfrmOutStateSeqErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_state_seq_error_packets_total"), + "Sequence error i.e. Sequence number overflow", + nil, nil, + ) + xfrmOutStateExpiredDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_state_expired_packets_total"), + "State is expired", + nil, nil, + ) + xfrmOutPolBlockDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_pol_block_packets_total"), + "Policy discards", + nil, nil, + ) + xfrmOutPolDeadDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_pol_dead_packets_total"), + "Policy is dead", + nil, nil, + ) + xfrmOutPolErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_pol_error_packets_total"), + "Policy error", + nil, nil, + ) + xfrmFwdHdrErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "fwd_hdr_error_packets_total"), + "Forward routing of a packet is not allowed", + nil, nil, + ) + xfrmOutStateInvalidDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "out_state_invalid_packets_total"), + "State is invalid, perhaps expired", + nil, nil, + ) + xfrmAcquireErrorDesc = prometheus.NewDesc( + prometheus.BuildFQName(namespace, "xfrm", "acquire_error_packets_total"), + "State hasn’t been fully acquired before use", + nil, nil, + ) +) + +func (c *xfrmCollector) Update(ch chan<- prometheus.Metric) error { + stat, err := c.fs.NewXfrmStat() + if err != nil { + return err + } + + ch <- prometheus.MustNewConstMetric(xfrmInErrorDesc, prometheus.CounterValue, float64(stat.XfrmInError)) + ch <- prometheus.MustNewConstMetric(xfrmInBufferErrorDesc, prometheus.CounterValue, float64(stat.XfrmInBufferError)) + ch <- prometheus.MustNewConstMetric(xfrmInHdrErrorDesc, prometheus.CounterValue, float64(stat.XfrmInHdrError)) + ch <- prometheus.MustNewConstMetric(xfrmInNoStatesDesc, prometheus.CounterValue, float64(stat.XfrmInNoStates)) + ch <- prometheus.MustNewConstMetric(xfrmInStateProtoErrorDesc, prometheus.CounterValue, float64(stat.XfrmInStateProtoError)) + ch <- prometheus.MustNewConstMetric(xfrmInStateModeErrorDesc, prometheus.CounterValue, float64(stat.XfrmInStateModeError)) + ch <- prometheus.MustNewConstMetric(xfrmInStateSeqErrorDesc, prometheus.CounterValue, float64(stat.XfrmInStateSeqError)) + ch <- prometheus.MustNewConstMetric(xfrmInStateExpiredDesc, prometheus.CounterValue, float64(stat.XfrmInStateExpired)) + ch <- prometheus.MustNewConstMetric(xfrmInStateMismatchDesc, prometheus.CounterValue, float64(stat.XfrmInStateMismatch)) + ch <- prometheus.MustNewConstMetric(xfrmInStateInvalidDesc, prometheus.CounterValue, float64(stat.XfrmInStateInvalid)) + ch <- prometheus.MustNewConstMetric(xfrmInTmplMismatchDesc, prometheus.CounterValue, float64(stat.XfrmInTmplMismatch)) + ch <- prometheus.MustNewConstMetric(xfrmInNoPolsDesc, prometheus.CounterValue, float64(stat.XfrmInNoPols)) + ch <- prometheus.MustNewConstMetric(xfrmInPolBlockDesc, prometheus.CounterValue, float64(stat.XfrmInPolBlock)) + ch <- prometheus.MustNewConstMetric(xfrmInPolErrorDesc, prometheus.CounterValue, float64(stat.XfrmInPolError)) + ch <- prometheus.MustNewConstMetric(xfrmOutErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutError)) + ch <- prometheus.MustNewConstMetric(xfrmOutBundleGenErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutBundleGenError)) + ch <- prometheus.MustNewConstMetric(xfrmOutBundleCheckErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutBundleCheckError)) + ch <- prometheus.MustNewConstMetric(xfrmOutNoStatesDesc, prometheus.CounterValue, float64(stat.XfrmOutNoStates)) + ch <- prometheus.MustNewConstMetric(xfrmOutStateProtoErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutStateProtoError)) + ch <- prometheus.MustNewConstMetric(xfrmOutStateModeErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutStateModeError)) + ch <- prometheus.MustNewConstMetric(xfrmOutStateSeqErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutStateSeqError)) + ch <- prometheus.MustNewConstMetric(xfrmOutStateExpiredDesc, prometheus.CounterValue, float64(stat.XfrmOutStateExpired)) + ch <- prometheus.MustNewConstMetric(xfrmOutPolBlockDesc, prometheus.CounterValue, float64(stat.XfrmOutPolBlock)) + ch <- prometheus.MustNewConstMetric(xfrmOutPolDeadDesc, prometheus.CounterValue, float64(stat.XfrmOutPolDead)) + ch <- prometheus.MustNewConstMetric(xfrmOutPolErrorDesc, prometheus.CounterValue, float64(stat.XfrmOutPolError)) + ch <- prometheus.MustNewConstMetric(xfrmFwdHdrErrorDesc, prometheus.CounterValue, float64(stat.XfrmFwdHdrError)) + ch <- prometheus.MustNewConstMetric(xfrmOutStateInvalidDesc, prometheus.CounterValue, float64(stat.XfrmOutStateInvalid)) + ch <- prometheus.MustNewConstMetric(xfrmAcquireErrorDesc, prometheus.CounterValue, float64(stat.XfrmAcquireError)) + + return err +} diff --git a/collector/xfrm_test.go b/collector/xfrm_test.go new file mode 100644 index 0000000000..2e1ac02899 --- /dev/null +++ b/collector/xfrm_test.go @@ -0,0 +1,151 @@ +// Copyright 2023 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !noxfrm +// +build !noxfrm + +package collector + +import ( + "fmt" + "os" + "strings" + "testing" + + "github.com/go-kit/log" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/testutil" +) + +type testXfrmCollector struct { + xc Collector +} + +func (c testXfrmCollector) Collect(ch chan<- prometheus.Metric) { + c.xc.Update(ch) +} + +func (c testXfrmCollector) Describe(ch chan<- *prometheus.Desc) { + prometheus.DescribeByCollect(c, ch) +} + +func TestXfrmStats(t *testing.T) { + testcase := `# HELP node_xfrm_acquire_error_packets_total State hasn’t been fully acquired before use + # TYPE node_xfrm_acquire_error_packets_total counter + node_xfrm_acquire_error_packets_total 24532 + # HELP node_xfrm_fwd_hdr_error_packets_total Forward routing of a packet is not allowed + # TYPE node_xfrm_fwd_hdr_error_packets_total counter + node_xfrm_fwd_hdr_error_packets_total 6654 + # HELP node_xfrm_in_buffer_error_packets_total No buffer is left + # TYPE node_xfrm_in_buffer_error_packets_total counter + node_xfrm_in_buffer_error_packets_total 2 + # HELP node_xfrm_in_error_packets_total All errors not matched by other + # TYPE node_xfrm_in_error_packets_total counter + node_xfrm_in_error_packets_total 1 + # HELP node_xfrm_in_hdr_error_packets_total Header error + # TYPE node_xfrm_in_hdr_error_packets_total counter + node_xfrm_in_hdr_error_packets_total 4 + # HELP node_xfrm_in_no_pols_packets_total No policy is found for states e.g. Inbound SAs are correct but no SP is found + # TYPE node_xfrm_in_no_pols_packets_total counter + node_xfrm_in_no_pols_packets_total 65432 + # HELP node_xfrm_in_no_states_packets_total No state is found i.e. Either inbound SPI, address, or IPsec protocol at SA is wrong + # TYPE node_xfrm_in_no_states_packets_total counter + node_xfrm_in_no_states_packets_total 3 + # HELP node_xfrm_in_pol_block_packets_total Policy discards + # TYPE node_xfrm_in_pol_block_packets_total counter + node_xfrm_in_pol_block_packets_total 100 + # HELP node_xfrm_in_pol_error_packets_total Policy error + # TYPE node_xfrm_in_pol_error_packets_total counter + node_xfrm_in_pol_error_packets_total 10000 + # HELP node_xfrm_in_state_expired_packets_total State is expired + # TYPE node_xfrm_in_state_expired_packets_total counter + node_xfrm_in_state_expired_packets_total 7 + # HELP node_xfrm_in_state_invalid_packets_total State is invalid + # TYPE node_xfrm_in_state_invalid_packets_total counter + node_xfrm_in_state_invalid_packets_total 55555 + # HELP node_xfrm_in_state_mismatch_packets_total State has mismatch option e.g. UDP encapsulation type is mismatch + # TYPE node_xfrm_in_state_mismatch_packets_total counter + node_xfrm_in_state_mismatch_packets_total 23451 + # HELP node_xfrm_in_state_mode_error_packets_total Transformation mode specific error + # TYPE node_xfrm_in_state_mode_error_packets_total counter + node_xfrm_in_state_mode_error_packets_total 100 + # HELP node_xfrm_in_state_proto_error_packets_total Transformation protocol specific error e.g. SA key is wrong + # TYPE node_xfrm_in_state_proto_error_packets_total counter + node_xfrm_in_state_proto_error_packets_total 40 + # HELP node_xfrm_in_state_seq_error_packets_total Sequence error i.e. Sequence number is out of window + # TYPE node_xfrm_in_state_seq_error_packets_total counter + node_xfrm_in_state_seq_error_packets_total 6000 + # HELP node_xfrm_in_tmpl_mismatch_packets_total No matching template for states e.g. Inbound SAs are correct but SP rule is wrong + # TYPE node_xfrm_in_tmpl_mismatch_packets_total counter + node_xfrm_in_tmpl_mismatch_packets_total 51 + # HELP node_xfrm_out_bundle_check_error_packets_total Bundle check error + # TYPE node_xfrm_out_bundle_check_error_packets_total counter + node_xfrm_out_bundle_check_error_packets_total 555 + # HELP node_xfrm_out_bundle_gen_error_packets_total Bundle generation error + # TYPE node_xfrm_out_bundle_gen_error_packets_total counter + node_xfrm_out_bundle_gen_error_packets_total 43321 + # HELP node_xfrm_out_error_packets_total All errors which is not matched others + # TYPE node_xfrm_out_error_packets_total counter + node_xfrm_out_error_packets_total 1e+06 + # HELP node_xfrm_out_no_states_packets_total No state is found + # TYPE node_xfrm_out_no_states_packets_total counter + node_xfrm_out_no_states_packets_total 869 + # HELP node_xfrm_out_pol_block_packets_total Policy discards + # TYPE node_xfrm_out_pol_block_packets_total counter + node_xfrm_out_pol_block_packets_total 43456 + # HELP node_xfrm_out_pol_dead_packets_total Policy is dead + # TYPE node_xfrm_out_pol_dead_packets_total counter + node_xfrm_out_pol_dead_packets_total 7656 + # HELP node_xfrm_out_pol_error_packets_total Policy error + # TYPE node_xfrm_out_pol_error_packets_total counter + node_xfrm_out_pol_error_packets_total 1454 + # HELP node_xfrm_out_state_expired_packets_total State is expired + # TYPE node_xfrm_out_state_expired_packets_total counter + node_xfrm_out_state_expired_packets_total 565 + # HELP node_xfrm_out_state_invalid_packets_total State is invalid, perhaps expired + # TYPE node_xfrm_out_state_invalid_packets_total counter + node_xfrm_out_state_invalid_packets_total 28765 + # HELP node_xfrm_out_state_mode_error_packets_total Transformation mode specific error + # TYPE node_xfrm_out_state_mode_error_packets_total counter + node_xfrm_out_state_mode_error_packets_total 8 + # HELP node_xfrm_out_state_proto_error_packets_total Transformation protocol specific error + # TYPE node_xfrm_out_state_proto_error_packets_total counter + node_xfrm_out_state_proto_error_packets_total 4542 + # HELP node_xfrm_out_state_seq_error_packets_total Sequence error i.e. Sequence number overflow + # TYPE node_xfrm_out_state_seq_error_packets_total counter + node_xfrm_out_state_seq_error_packets_total 543 + ` + *procPath = "fixtures/proc" + + logger := log.NewLogfmtLogger(os.Stderr) + c, err := NewXfrmCollector(logger) + if err != nil { + t.Fatal(err) + } + reg := prometheus.NewRegistry() + reg.MustRegister(&testXfrmCollector{xc: c}) + + sink := make(chan prometheus.Metric) + go func() { + err = c.Update(sink) + if err != nil { + panic(fmt.Errorf("failed to update collector: %s", err)) + } + close(sink) + }() + + err = testutil.GatherAndCompare(reg, strings.NewReader(testcase)) + if err != nil { + t.Fatal(err) + } +} diff --git a/collector/zfs.go b/collector/zfs.go index 8ddbe3c278..df1a97aec3 100644 --- a/collector/zfs.go +++ b/collector/zfs.go @@ -52,7 +52,7 @@ func NewZFSCollector(logger log.Logger) (Collector, error) { linuxPathMap: map[string]string{ "zfs_abd": "abdstats", "zfs_arc": "arcstats", - "zfs_dbuf": "dbuf_stats", + "zfs_dbuf": "dbufstats", "zfs_dmu_tx": "dmu_tx", "zfs_dnode": "dnodestats", "zfs_fm": "fm", diff --git a/collector/zfs_freebsd.go b/collector/zfs_freebsd.go index 2418b229d0..804d4f58a9 100644 --- a/collector/zfs_freebsd.go +++ b/collector/zfs_freebsd.go @@ -17,9 +17,8 @@ package collector import ( - "fmt" - "github.com/go-kit/log" + "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" ) @@ -214,6 +213,7 @@ func NewZfsCollector(logger log.Logger) (Collector, error) { dataType: bsdSysctlTypeUint64, valueType: prometheus.GaugeValue, }, + // when FreeBSD 14.0+, `meta/pm/pd` install of `p`. { name: "arcstats_p_bytes", description: "ZFS ARC MRU target size", @@ -221,6 +221,27 @@ func NewZfsCollector(logger log.Logger) (Collector, error) { dataType: bsdSysctlTypeUint64, valueType: prometheus.GaugeValue, }, + { + name: "arcstats_meta_bytes", + description: "ZFS ARC metadata target frac ", + mib: "kstat.zfs.misc.arcstats.meta", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, + { + name: "arcstats_pd_bytes", + description: "ZFS ARC data MRU target frac", + mib: "kstat.zfs.misc.arcstats.pd", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, + { + name: "arcstats_pm_bytes", + description: "ZFS ARC meta MRU target frac", + mib: "kstat.zfs.misc.arcstats.pm", + dataType: bsdSysctlTypeUint64, + valueType: prometheus.GaugeValue, + }, { name: "arcstats_size_bytes", description: "ZFS ARC size", @@ -251,7 +272,9 @@ func (c *zfsCollector) Update(ch chan<- prometheus.Metric) error { for _, m := range c.sysctls { v, err := m.Value() if err != nil { - return fmt.Errorf("couldn't get sysctl: %w", err) + // debug logging + level.Debug(c.logger).Log("name", m.name, "mib", m.mib, "couldn't get sysctl:", err) + continue } ch <- prometheus.MustNewConstMetric( diff --git a/collector/zfs_linux.go b/collector/zfs_linux.go index ca29ff69d8..ec195b3d62 100644 --- a/collector/zfs_linux.go +++ b/collector/zfs_linux.go @@ -35,14 +35,14 @@ const ( // kstatDataChar = "0" // kstatDataInt32 = "1" // kstatDataUint32 = "2" - // kstatDataInt64 = "3" + kstatDataInt64 = "3" kstatDataUint64 = "4" // kstatDataLong = "5" // kstatDataUlong = "6" // kstatDataString = "7" ) -var zfsPoolStatesName = []string{"online", "degraded", "faulted", "offline", "removed", "unavail"} +var zfsPoolStatesName = []string{"online", "degraded", "faulted", "offline", "removed", "unavail", "suspended"} func (c *zfsCollector) openProcFile(path string) (*os.File, error) { file, err := os.Open(procFilePath(path)) @@ -163,7 +163,7 @@ func (c *zfsCollector) parseProcfsFile(reader io.Reader, fmtExt string, handler // kstat data type (column 2) should be KSTAT_DATA_UINT64, otherwise ignore // TODO: when other KSTAT_DATA_* types arrive, much of this will need to be restructured - if parts[1] == kstatDataUint64 { + if parts[1] == kstatDataUint64 || parts[1] == kstatDataInt64 { key := fmt.Sprintf("kstat.zfs.misc.%s.%s", fmtExt, parts[0]) value, err := strconv.ParseUint(parts[2], 10, 64) if err != nil { diff --git a/collector/zfs_linux_test.go b/collector/zfs_linux_test.go index b9aec14480..69e4ed8fc1 100644 --- a/collector/zfs_linux_test.go +++ b/collector/zfs_linux_test.go @@ -391,7 +391,7 @@ func TestAbdstatsParsing(t *testing.T) { } func TestDbufstatsParsing(t *testing.T) { - dbufstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/dbuf_stats") + dbufstatsFile, err := os.Open("fixtures/proc/spl/kstat/zfs/dbufstats") if err != nil { t.Fatal(err) } @@ -535,6 +535,15 @@ func TestPoolStateParsing(t *testing.T) { t.Fatalf("Incorrect parsed value for degraded state") } } + if poolName == "pool2" { + if isActive != uint64(1) && stateName == "suspended" { + t.Fatalf("Incorrect parsed value for suspended state") + } + if isActive != uint64(0) && stateName != "suspended" { + t.Fatalf("Incorrect parsed value for suspended state") + } + } + }) file.Close() if err != nil { diff --git a/collector/zfs_solaris.go b/collector/zfs_solaris.go index 040f31dbbd..52f2500f25 100644 --- a/collector/zfs_solaris.go +++ b/collector/zfs_solaris.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build solaris && !nozfs -// +build solaris,!nozfs +//go:build !nozfs +// +build !nozfs package collector diff --git a/docs/TIME.md b/docs/TIME.md index 340c72d65c..4f0b01a04b 100644 --- a/docs/TIME.md +++ b/docs/TIME.md @@ -2,6 +2,8 @@ ## `ntp` collector +NOTE: This collector is deprecated and will be removed in the next major version release. + This collector is intended for usage with local NTP daemons including [ntp.org](http://ntp.org/), [chrony](https://chrony.tuxfamily.org/comparison.html), and [OpenNTPD](http://www.openntpd.org/). Note, some chrony packages have `local stratum 10` configuration value making chrony a valid server when it is unsynchronised. This configuration makes one of the heuristics that derive `node_ntp_sanity` unreliable. diff --git a/docs/node-mixin/alerts/alerts.libsonnet b/docs/node-mixin/alerts/alerts.libsonnet index 6fa1454677..c346480906 100644 --- a/docs/node-mixin/alerts/alerts.libsonnet +++ b/docs/node-mixin/alerts/alerts.libsonnet @@ -8,11 +8,11 @@ alert: 'NodeFilesystemSpaceFillingUp', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < %(fsSpaceFillingUpWarningThreshold)d + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceFillingUpWarningThreshold)d and - predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 24*60*60) < 0 + predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[%(fsSpaceFillingUpPredictionWindow)s], 24*60*60) < 0 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -21,18 +21,18 @@ }, annotations: { summary: 'Filesystem is predicted to run out of space within the next 24 hours.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up.', }, }, { alert: 'NodeFilesystemSpaceFillingUp', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < %(fsSpaceFillingUpCriticalThreshold)d + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceFillingUpCriticalThreshold)d and - predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 4*60*60) < 0 + predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[6h], 4*60*60) < 0 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -41,16 +41,16 @@ }, annotations: { summary: 'Filesystem is predicted to run out of space within the next 4 hours.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up fast.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up fast.', }, }, { alert: 'NodeFilesystemAlmostOutOfSpace', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < %(fsSpaceAvailableWarningThreshold)d + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceAvailableWarningThreshold)d and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '30m', @@ -59,16 +59,16 @@ }, annotations: { summary: 'Filesystem has less than %(fsSpaceAvailableWarningThreshold)d%% space left.' % $._config, - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.', }, }, { alert: 'NodeFilesystemAlmostOutOfSpace', expr: ||| ( - node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < %(fsSpaceAvailableCriticalThreshold)d + node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceAvailableCriticalThreshold)d and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '30m', @@ -77,18 +77,18 @@ }, annotations: { summary: 'Filesystem has less than %(fsSpaceAvailableCriticalThreshold)d%% space left.' % $._config, - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.', }, }, { alert: 'NodeFilesystemFilesFillingUp', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 40 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < 40 and - predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 24*60*60) < 0 + predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[6h], 24*60*60) < 0 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -97,18 +97,18 @@ }, annotations: { summary: 'Filesystem is predicted to run out of inodes within the next 24 hours.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up.', }, }, { alert: 'NodeFilesystemFilesFillingUp', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 20 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < 20 and - predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s}[6h], 4*60*60) < 0 + predict_linear(node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[6h], 4*60*60) < 0 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -117,16 +117,16 @@ }, annotations: { summary: 'Filesystem is predicted to run out of inodes within the next 4 hours.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up fast.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up fast.', }, }, { alert: 'NodeFilesystemAlmostOutOfFiles', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 5 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < 5 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -135,16 +135,16 @@ }, annotations: { summary: 'Filesystem has less than 5% inodes left.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.', }, }, { alert: 'NodeFilesystemAlmostOutOfFiles', expr: ||| ( - node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s} * 100 < 3 + node_filesystem_files_free{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_files{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < 3 and - node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s} == 0 + node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 ) ||| % $._config, 'for': '1h', @@ -153,13 +153,13 @@ }, annotations: { summary: 'Filesystem has less than 3% inodes left.', - description: 'Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.', + description: 'Filesystem on {{ $labels.device }}, mounted on {{ $labels.mountpoint }}, at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.', }, }, { alert: 'NodeNetworkReceiveErrs', expr: ||| - rate(node_network_receive_errs_total[2m]) / rate(node_network_receive_packets_total[2m]) > 0.01 + rate(node_network_receive_errs_total{%(nodeExporterSelector)s}[2m]) / rate(node_network_receive_packets_total{%(nodeExporterSelector)s}[2m]) > 0.01 ||| % $._config, 'for': '1h', labels: { @@ -173,7 +173,7 @@ { alert: 'NodeNetworkTransmitErrs', expr: ||| - rate(node_network_transmit_errs_total[2m]) / rate(node_network_transmit_packets_total[2m]) > 0.01 + rate(node_network_transmit_errs_total{%(nodeExporterSelector)s}[2m]) / rate(node_network_transmit_packets_total{%(nodeExporterSelector)s}[2m]) > 0.01 ||| % $._config, 'for': '1h', labels: { @@ -187,7 +187,7 @@ { alert: 'NodeHighNumberConntrackEntriesUsed', expr: ||| - (node_nf_conntrack_entries / node_nf_conntrack_entries_limit) > 0.75 + (node_nf_conntrack_entries{%(nodeExporterSelector)s} / node_nf_conntrack_entries_limit) > 0.75 ||| % $._config, annotations: { summary: 'Number of conntrack are getting close to the limit.', @@ -204,7 +204,7 @@ ||| % $._config, annotations: { summary: 'Node Exporter text file collector failed to scrape.', - description: 'Node Exporter text file collector failed to scrape.', + description: 'Node Exporter text file collector on {{ $labels.instance }} failed to scrape.', }, labels: { severity: 'warning', @@ -231,7 +231,7 @@ }, annotations: { summary: 'Clock skew detected.', - description: 'Clock on {{ $labels.instance }} is out of sync by more than 300s. Ensure NTP is configured correctly on this host.', + description: 'Clock at {{ $labels.instance }} is out of sync by more than 0.05s. Ensure NTP is configured correctly on this host.', }, }, { @@ -247,7 +247,7 @@ }, annotations: { summary: 'Clock not synchronising.', - description: 'Clock on {{ $labels.instance }} is not synchronising. Ensure NTP is configured on this host.', + description: 'Clock at {{ $labels.instance }} is not synchronising. Ensure NTP is configured on this host.', }, }, { @@ -260,8 +260,8 @@ severity: 'critical', }, annotations: { - summary: 'RAID Array is degraded', - description: "RAID array '{{ $labels.device }}' on {{ $labels.instance }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.", + summary: 'RAID Array is degraded.', + description: "RAID array '{{ $labels.device }}' at {{ $labels.instance }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.", }, }, { @@ -273,8 +273,8 @@ severity: 'warning', }, annotations: { - summary: 'Failed device in RAID array', - description: "At least one device in RAID array on {{ $labels.instance }} failed. Array '{{ $labels.device }}' needs attention and possibly a disk swap.", + summary: 'Failed device in RAID array.', + description: "At least one device in RAID array at {{ $labels.instance }} failed. Array '{{ $labels.device }}' needs attention and possibly a disk swap.", }, }, { @@ -309,6 +309,118 @@ description: 'File descriptors limit at {{ $labels.instance }} is currently at {{ printf "%.2f" $value }}%.', }, }, + { + alert: 'NodeCPUHighUsage', + expr: ||| + sum without(mode) (avg without (cpu) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode!="idle"}[2m]))) * 100 > %(cpuHighUsageThreshold)d + ||| % $._config, + 'for': '15m', + labels: { + severity: 'info', + }, + annotations: { + summary: 'High CPU usage.', + description: ||| + CPU usage at {{ $labels.instance }} has been above %(cpuHighUsageThreshold)d%% for the last 15 minutes, is currently at {{ printf "%%.2f" $value }}%%. + ||| % $._config, + }, + }, + { + alert: 'NodeSystemSaturation', + expr: ||| + node_load1{%(nodeExporterSelector)s} + / count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle"}) > %(systemSaturationPerCoreThreshold)d + ||| % $._config, + 'for': '15m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'System saturated, load per core is very high.', + description: ||| + System load per core at {{ $labels.instance }} has been above %(systemSaturationPerCoreThreshold)d for the last 15 minutes, is currently at {{ printf "%%.2f" $value }}. + This might indicate this instance resources saturation and can cause it becoming unresponsive. + ||| % $._config, + }, + }, + { + alert: 'NodeMemoryMajorPagesFaults', + expr: ||| + rate(node_vmstat_pgmajfault{%(nodeExporterSelector)s}[5m]) > %(memoryMajorPagesFaultsThreshold)d + ||| % $._config, + 'for': '15m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Memory major page faults are occurring at very high rate.', + description: ||| + Memory major pages are occurring at very high rate at {{ $labels.instance }}, %(memoryMajorPagesFaultsThreshold)d major page faults per second for the last 15 minutes, is currently at {{ printf "%%.2f" $value }}. + Please check that there is enough memory available at this instance. + ||| % $._config, + }, + }, + { + alert: 'NodeMemoryHighUtilization', + expr: ||| + 100 - (node_memory_MemAvailable_bytes{%(nodeExporterSelector)s} / node_memory_MemTotal_bytes{%(nodeExporterSelector)s} * 100) > %(memoryHighUtilizationThreshold)d + ||| % $._config, + 'for': '15m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Host is running out of memory.', + description: ||| + Memory is filling up at {{ $labels.instance }}, has been above %(memoryHighUtilizationThreshold)d%% for the last 15 minutes, is currently at {{ printf "%%.2f" $value }}%%. + ||| % $._config, + }, + }, + { + alert: 'NodeDiskIOSaturation', + expr: ||| + rate(node_disk_io_time_weighted_seconds_total{%(nodeExporterSelector)s, %(diskDeviceSelector)s}[5m]) > %(diskIOSaturationThreshold)d + ||| % $._config, + 'for': '30m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Disk IO queue is high.', + description: ||| + Disk IO queue (aqu-sq) is high on {{ $labels.device }} at {{ $labels.instance }}, has been above %(diskIOSaturationThreshold)d for the last 30 minutes, is currently at {{ printf "%%.2f" $value }}. + This symptom might indicate disk saturation. + ||| % $._config, + }, + }, + { + alert: 'NodeSystemdServiceFailed', + expr: ||| + node_systemd_unit_state{%(nodeExporterSelector)s, state="failed"} == 1 + ||| % $._config, + 'for': '5m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Systemd service has entered failed state.', + description: 'Systemd service {{ $labels.name }} has entered failed state at {{ $labels.instance }}', + }, + }, + { + alert: 'NodeBondingDegraded', + expr: ||| + (node_bonding_slaves - node_bonding_active) != 0 + ||| % $._config, + 'for': '5m', + labels: { + severity: 'warning', + }, + annotations: { + summary: 'Bonding interface is degraded', + description: 'Bonding interface {{ $labels.master }} on {{ $labels.instance }} is in degraded state due to one or more slave failures.', + }, + }, ], }, ], diff --git a/docs/node-mixin/config.libsonnet b/docs/node-mixin/config.libsonnet index f16796c4d6..df2af23f92 100644 --- a/docs/node-mixin/config.libsonnet +++ b/docs/node-mixin/config.libsonnet @@ -16,6 +16,14 @@ // alerting, you can exclude them here, e.g. 'fstype!="tmpfs"'. fsSelector: 'fstype!=""', + // Select the mountpoint for filesystem-related queries. If left + // empty, all mountpoints are selected. For example if you have a + // special purpose tmpfs instance that has a fixed size and will + // always be 100% full, but you still want alerts and dashboards for + // other tmpfs instances, you can exclude those by mountpoint prefix + // like so: 'mountpoint!~"/var/lib/foo.*"'. + fsMountpointSelector: 'mountpoint!=""', + // Select the device for disk-related queries. If left empty, all // devices are selected. If you have unusual devices you don't // want to include in dashboards and alerting, you can exclude @@ -35,23 +43,48 @@ // just a warning for K8s nodes. nodeCriticalSeverity: 'critical', + // CPU utilization (%) on which to trigger the + // 'NodeCPUHighUsage' alert. + cpuHighUsageThreshold: 90, + // Load average 1m (per core) on which to trigger the + // 'NodeSystemSaturation' alert. + systemSaturationPerCoreThreshold: 2, + // Available disk space (%) thresholds on which to trigger the // 'NodeFilesystemSpaceFillingUp' alerts. These alerts fire if the disk // usage grows in a way that it is predicted to run out in 4h or 1d // and if the provided thresholds have been reached right now. - // In some cases you'll want to adjust these, e.g. by default Kubernetes + // In some cases you'll want to adjust these, e.g., by default, Kubernetes // runs the image garbage collection when the disk usage reaches 85% // of its available space. In that case, you'll want to reduce the // critical threshold below to something like 14 or 15, otherwise // the alert could fire under normal node usage. + // Additionally, the prediction window for the alert can be configured + // to account for environments where disk usage can fluctuate within + // a short time frame. By extending the prediction window, you can + // reduce false positives caused by temporary spikes, providing a + // more accurate prediction of disk space issues. fsSpaceFillingUpWarningThreshold: 40, fsSpaceFillingUpCriticalThreshold: 20, + fsSpaceFillingUpPredictionWindow: '6h', // Available disk space (%) thresholds on which to trigger the // 'NodeFilesystemAlmostOutOfSpace' alerts. fsSpaceAvailableWarningThreshold: 5, fsSpaceAvailableCriticalThreshold: 3, + // Memory utilization (%) level on which to trigger the + // 'NodeMemoryHighUtilization' alert. + memoryHighUtilizationThreshold: 90, + + // Threshold for the rate of memory major page faults to trigger + // 'NodeMemoryMajorPagesFaults' alert. + memoryMajorPagesFaultsThreshold: 500, + + // Disk IO queue level above which to trigger + // 'NodeDiskIOSaturation' alert. + diskIOSaturationThreshold: 10, + rateInterval: '5m', // Opt-in for multi-cluster support. showMultiCluster: false, diff --git a/docs/node-mixin/dashboards/use.libsonnet b/docs/node-mixin/dashboards/use.libsonnet index 7b937b222f..65e96dd8dc 100644 --- a/docs/node-mixin/dashboards/use.libsonnet +++ b/docs/node-mixin/dashboards/use.libsonnet @@ -307,12 +307,12 @@ local diskSpaceUtilisation = ||| sum without (device) ( max without (fstype, mountpoint) (( - node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(clusterLabel)s="$cluster"} + node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"} - - node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(clusterLabel)s="$cluster"} + node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"} ) != 0) ) - / scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(clusterLabel)s="$cluster"}))) + / scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s, %(clusterLabel)s="$cluster"}))) ||| % $._config, legendFormat='{{instance}}' )) ) @@ -453,10 +453,10 @@ local diskSpaceUtilisation = sum ( sum without (device) ( max without (fstype, mountpoint, instance, pod) (( - node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s} - node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s} + node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s} - node_filesystem_avail_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s} ) != 0) ) - / scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s}))) + / scalar(sum(max without (fstype, mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, %(fsSelector)s, %(fsMountpointSelector)s}))) ) by (%(clusterLabel)s) ||| % $._config, legendFormat='{{%(clusterLabel)s}}' % $._config )) diff --git a/docs/node-mixin/lib/prom-mixin.libsonnet b/docs/node-mixin/lib/prom-mixin.libsonnet index 6b541ac360..5d2e7bd0ce 100644 --- a/docs/node-mixin/lib/prom-mixin.libsonnet +++ b/docs/node-mixin/lib/prom-mixin.libsonnet @@ -27,6 +27,23 @@ local table = grafana70.panel.table; type: 'datasource', }, + local clusterTemplatePrototype = + template.new( + 'cluster', + '$datasource', + '', + hide=if config.showMultiCluster then '' else '2', + refresh='time', + label='Cluster', + ), + local clusterTemplate = + if platform == 'Darwin' then + clusterTemplatePrototype + { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, sysname="Darwin"}, %(clusterLabel)s)' % config } + else + clusterTemplatePrototype + { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, sysname!="Darwin"}, %(clusterLabel)s)' % config }, + local instanceTemplatePrototype = template.new( 'instance', @@ -38,11 +55,10 @@ local table = grafana70.panel.table; local instanceTemplate = if platform == 'Darwin' then instanceTemplatePrototype - { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, sysname="Darwin"}, instance)' % config } + { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster", sysname="Darwin"}, instance)' % config } else instanceTemplatePrototype - { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, sysname!="Darwin"}, instance)' % config }, - + { query: 'label_values(node_uname_info{%(nodeExporterSelector)s, %(clusterLabel)s="$cluster", sysname!="Darwin"}, instance)' % config }, local idleCPU = graphPanel.new( @@ -57,9 +73,9 @@ local table = grafana70.panel.table; .addTarget(prometheus.target( ||| ( - (1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance"}[$__rate_interval]))) + (1 - sum without (mode) (rate(node_cpu_seconds_total{%(nodeExporterSelector)s, mode=~"idle|iowait|steal", instance="$instance", %(clusterLabel)s="$cluster"}[$__rate_interval]))) / ignoring(cpu) group_left - count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance"}) + count without (cpu, mode) (node_cpu_seconds_total{%(nodeExporterSelector)s, mode="idle", instance="$instance", %(clusterLabel)s="$cluster"}) ) ||| % config, legendFormat='{{cpu}}', @@ -75,10 +91,10 @@ local table = grafana70.panel.table; min=0, fill=0, ) - .addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='1m load average')) - .addTarget(prometheus.target('node_load5{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='5m load average')) - .addTarget(prometheus.target('node_load15{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='15m load average')) - .addTarget(prometheus.target('count(node_cpu_seconds_total{%(nodeExporterSelector)s, instance="$instance", mode="idle"})' % config, legendFormat='logical cores')), + .addTarget(prometheus.target('node_load1{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='1m load average')) + .addTarget(prometheus.target('node_load5{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='5m load average')) + .addTarget(prometheus.target('node_load15{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='15m load average')) + .addTarget(prometheus.target('count(node_cpu_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", mode="idle"})' % config, legendFormat='logical cores')), local memoryGraphPanelPrototype = graphPanel.new( @@ -94,44 +110,44 @@ local table = grafana70.panel.table; .addTarget(prometheus.target( ||| ( - node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} - - node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} - - node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} - - node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} ) ||| % config, legendFormat='memory used' )) - .addTarget(prometheus.target('node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='memory buffers')) - .addTarget(prometheus.target('node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='memory cached')) - .addTarget(prometheus.target('node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='memory free')) + .addTarget(prometheus.target('node_memory_Buffers_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='memory buffers')) + .addTarget(prometheus.target('node_memory_Cached_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='memory cached')) + .addTarget(prometheus.target('node_memory_MemFree_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='memory free')) else if platform == 'Darwin' then // not useful to stack memoryGraphPanelPrototype { stack: false } - .addTarget(prometheus.target('node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='Physical Memory')) + .addTarget(prometheus.target('node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Physical Memory')) .addTarget(prometheus.target( ||| ( - node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance"} - - node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance"} + - node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance"} + - node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} - + node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} + + node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} + + node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} ) ||| % config, legendFormat='Memory Used' )) .addTarget(prometheus.target( ||| ( - node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance"} - - node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance"} + node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} - + node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"} ) ||| % config, legendFormat='App Memory' )) - .addTarget(prometheus.target('node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='Wired Memory')) - .addTarget(prometheus.target('node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance"}' % config, legendFormat='Compressed')), + .addTarget(prometheus.target('node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Wired Memory')) + .addTarget(prometheus.target('node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}' % config, legendFormat='Compressed')), // NOTE: avg() is used to circumvent a label change caused by a node_exporter rollout. local memoryGaugePanelPrototype = @@ -155,8 +171,8 @@ local table = grafana70.panel.table; ||| 100 - ( - avg(node_memory_MemAvailable_bytes{%(nodeExporterSelector)s, instance="$instance"}) / - avg(node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance"}) + avg(node_memory_MemAvailable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) / + avg(node_memory_MemTotal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) * 100 ) ||| % config, @@ -168,12 +184,12 @@ local table = grafana70.panel.table; ||| ( ( - avg(node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance"}) - - avg(node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance"}) + - avg(node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance"}) + - avg(node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance"}) + avg(node_memory_internal_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) - + avg(node_memory_purgeable_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) + + avg(node_memory_wired_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) + + avg(node_memory_compressed_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) ) / - avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance"}) + avg(node_memory_total_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster"}) ) * 100 @@ -190,17 +206,17 @@ local table = grafana70.panel.table; ) // TODO: Does it make sense to have those three in the same panel? .addTarget(prometheus.target( - 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config, + 'rate(node_disk_read_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config, legendFormat='{{device}} read', intervalFactor=1, )) .addTarget(prometheus.target( - 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config, + 'rate(node_disk_written_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config, legendFormat='{{device}} written', intervalFactor=1, )) .addTarget(prometheus.target( - 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(diskDeviceSelector)s}[$__rate_interval])' % config, + 'rate(node_disk_io_time_seconds_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(diskDeviceSelector)s}[$__rate_interval])' % config, legendFormat='{{device}} io time', intervalFactor=1, )) + @@ -232,7 +248,7 @@ local table = grafana70.panel.table; .addThresholdStep(color='red', value=0.9) .addTarget(prometheus.target( ||| - max by (mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}) + max by (mountpoint) (node_filesystem_size_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(fsSelector)s, %(fsMountpointSelector)s}) ||| % config, legendFormat='', instant=true, @@ -240,7 +256,7 @@ local table = grafana70.panel.table; )) .addTarget(prometheus.target( ||| - max by (mountpoint) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(fsSelector)s}) + max by (mountpoint) (node_filesystem_avail_bytes{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", %(fsSelector)s, %(fsMountpointSelector)s}) ||| % config, legendFormat='', instant=true, @@ -421,7 +437,7 @@ local table = grafana70.panel.table; fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config, + 'rate(node_network_receive_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", device!="lo"}[$__rate_interval]) * 8' % config, legendFormat='{{device}}', intervalFactor=1, )), @@ -437,7 +453,7 @@ local table = grafana70.panel.table; fill=0, ) .addTarget(prometheus.target( - 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", device!="lo"}[$__rate_interval]) * 8' % config, + 'rate(node_network_transmit_bytes_total{%(nodeExporterSelector)s, instance="$instance", %(clusterLabel)s="$cluster", device!="lo"}[$__rate_interval]) * 8' % config, legendFormat='{{device}}', intervalFactor=1, )), @@ -473,6 +489,7 @@ local table = grafana70.panel.table; local templates = [ prometheusDatasourceTemplate, + clusterTemplate, instanceTemplate, ], diff --git a/end-to-end-test.sh b/end-to-end-test.sh index 3ceb0eb28f..35e4534e6d 100755 --- a/end-to-end-test.sh +++ b/end-to-end-test.sh @@ -12,6 +12,7 @@ enabled_collectors=$(cat << COLLECTORS conntrack cpu cpufreq + cpu_vulnerabilities diskstats dmi drbd @@ -39,22 +40,25 @@ enabled_collectors=$(cat << COLLECTORS qdisc rapl schedstat - selinux slabinfo sockstat + softirqs stat sysctl textfile thermal_zone udp_queues vmstat + watchdog wifi + xfrm xfs zfs zoneinfo COLLECTORS ) disabled_collectors=$(cat << COLLECTORS + selinux filesystem timex uname @@ -128,8 +132,10 @@ fi --collector.textfile.directory="collector/fixtures/textfile/two_metric_files/" \ --collector.wifi.fixtures="collector/fixtures/wifi" \ --collector.qdisc.fixtures="collector/fixtures/qdisc/" \ - --collector.qdisk.device-include="(wlan0|eth0)" \ + --collector.qdisc.device-include="(wlan0|eth0)" \ --collector.arp.device-exclude="nope" \ + --no-collector.arp.netlink \ + --collector.hwmon.chip-include="(applesmc|coretemp|hwmon4|nct6779)" \ --collector.netclass.ignored-devices="(dmz|int)" \ --collector.netclass.ignore-invalid-speed \ --collector.netdev.device-include="lo" \ diff --git a/examples/systemd/README.md b/examples/systemd/README.md index 67039bed13..3b3577fa0f 100644 --- a/examples/systemd/README.md +++ b/examples/systemd/README.md @@ -2,7 +2,7 @@ If you are using distribution packages or the copr repository, you don't need to deal with these files! -The unit file in this directory is to be put into `/etc/systemd/system`. +The unit files (`*.service` and `*.socket`) in this directory are to be put into `/etc/systemd/system`. It needs a user named `node_exporter`, whose shell should be `/sbin/nologin` and should not have any special privileges. It needs a sysconfig file in `/etc/sysconfig/node_exporter`. It needs a directory named `/var/lib/node_exporter/textfile_collector`, whose owner should be `node_exporter`:`node_exporter`. diff --git a/examples/systemd/node_exporter.service b/examples/systemd/node_exporter.service index 64f1405b02..82553e91ee 100644 --- a/examples/systemd/node_exporter.service +++ b/examples/systemd/node_exporter.service @@ -1,10 +1,11 @@ [Unit] Description=Node Exporter +Requires=node_exporter.socket [Service] User=node_exporter EnvironmentFile=/etc/sysconfig/node_exporter -ExecStart=/usr/sbin/node_exporter $OPTIONS +ExecStart=/usr/sbin/node_exporter --web.systemd-socket $OPTIONS [Install] WantedBy=multi-user.target diff --git a/examples/systemd/node_exporter.socket b/examples/systemd/node_exporter.socket new file mode 100644 index 0000000000..c3e5670bfb --- /dev/null +++ b/examples/systemd/node_exporter.socket @@ -0,0 +1,8 @@ +[Unit] +Description=Node Exporter + +[Socket] +ListenStream=9100 + +[Install] +WantedBy=sockets.target diff --git a/go.mod b/go.mod index 0dfb38c94a..d287b6eea4 100644 --- a/go.mod +++ b/go.mod @@ -3,63 +3,64 @@ module github.com/prometheus/node_exporter go 1.23 require ( + github.com/alecthomas/kingpin/v2 v2.4.0 github.com/beevik/ntp v1.4.3 github.com/coreos/go-systemd/v22 v22.5.0 - github.com/dennwc/btrfs v0.0.0-20220403080356-b3db0b2dedac + github.com/dennwc/btrfs v0.0.0-20240418142341-0167142bde7a github.com/ema/qdisc v1.0.0 github.com/go-kit/log v0.2.1 github.com/godbus/dbus/v5 v5.1.0 github.com/hashicorp/go-envparse v0.1.0 github.com/hodgesds/perf-utils v0.7.0 github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 + github.com/josharian/native v1.1.0 github.com/jsimonetti/rtnetlink v1.4.2 github.com/lufia/iostat v1.2.1 github.com/mattn/go-xmlrpc v0.0.3 + github.com/mdlayher/ethtool v0.1.0 github.com/mdlayher/netlink v1.7.2 github.com/mdlayher/wifi v0.3.0 github.com/montanaflynn/stats v0.7.1 github.com/opencontainers/selinux v1.11.0 - github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.13.0 - github.com/prometheus/client_model v0.6.0 - github.com/prometheus/common v0.37.0 - github.com/prometheus/exporter-toolkit v0.7.2 - github.com/prometheus/procfs v0.8.0 + github.com/prometheus-community/go-runit v0.1.0 + github.com/prometheus/client_golang v1.19.0 + github.com/prometheus/client_model v0.6.1 + github.com/prometheus/common v0.53.0 + github.com/prometheus/exporter-toolkit v0.11.0 + github.com/prometheus/procfs v0.14.0 github.com/safchain/ethtool v0.4.1 - github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a github.com/stretchr/testify v1.9.0 github.com/tklauser/go-sysconf v0.3.14 + golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f golang.org/x/sys v0.26.0 - gopkg.in/alecthomas/kingpin.v2 v2.2.6 + howett.net/plist v1.0.1 ) require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dennwc/ioctl v1.0.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/josharian/native v1.1.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mdlayher/genetlink v1.3.2 // indirect github.com/mdlayher/socket v0.4.1 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect github.com/tklauser/numcpus v0.8.0 // indirect + github.com/xhit/go-str2duration/v2 v2.1.0 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect + golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/text v0.18.0 // indirect - google.golang.org/appengine v1.6.6 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index c4d0e6d8bc..eef1ec5435 100644 --- a/go.sum +++ b/go.sum @@ -1,188 +1,63 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/beevik/ntp v1.4.3 h1:PlbTvE5NNy4QHmA4Mg57n7mcFTmr1W1j3gcK7L1lqho= github.com/beevik/ntp v1.4.3/go.mod h1:Unr8Zg+2dRn7d8bHFuehIMSvvUYssHMxW3Q5Nx4RW5Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cilium/ebpf v0.12.3 h1:8ht6F9MquybnY97at+VDZb3eQQr8ev79RueWeVaEcG4= github.com/cilium/ebpf v0.12.3/go.mod h1:TctK1ivibvI3znr66ljgi4hqOT8EYQjz1KWBfb1UVgM= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dennwc/btrfs v0.0.0-20220403080356-b3db0b2dedac h1:cjfIEKdg/lZ+ewJk8FYoYZTN2HY/okVSPtmHLaYMAvE= -github.com/dennwc/btrfs v0.0.0-20220403080356-b3db0b2dedac/go.mod h1:MYsOV9Dgsec3FFSOjywi0QK5r6TeBbdWxdrMGtiYXHA= +github.com/dennwc/btrfs v0.0.0-20240418142341-0167142bde7a h1:KfFsGLJFVdCXlySUkV2FmxNtmiztpJb6tV+XYBmmv8E= +github.com/dennwc/btrfs v0.0.0-20240418142341-0167142bde7a/go.mod h1:MYsOV9Dgsec3FFSOjywi0QK5r6TeBbdWxdrMGtiYXHA= github.com/dennwc/ioctl v1.0.0 h1:DsWAAjIxRqNcLn9x6mwfuf2pet3iB7aK90K4tF16rLg= github.com/dennwc/ioctl v1.0.0/go.mod h1:ellh2YB5ldny99SBU/VX7Nq0xiZbHphf1DrtHxxjMk0= github.com/ema/qdisc v1.0.0 h1:EHLG08FVRbWLg8uRICa3xzC9Zm0m7HyMHfXobWFnXYg= github.com/ema/qdisc v1.0.0/go.mod h1:FhIc0fLYi7f+lK5maMsesDqwYojIOh3VfRs8EVd5YJQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/go-envparse v0.1.0 h1:bE++6bhIsNCPLvgDZkYqo3nA+/PFI51pkrHdmPSDFPY= github.com/hashicorp/go-envparse v0.1.0/go.mod h1:OHheN1GoygLlAkTlXLXvAdnXdZxy8JUweQ1rAXx1xnc= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hodgesds/perf-utils v0.7.0 h1:7KlHGMuig4FRH5fNw68PV6xLmgTe7jKs9hgAcEAbioU= github.com/hodgesds/perf-utils v0.7.0/go.mod h1:LAklqfDadNKpkxoAJNHpD5tkY0rkZEVdnCEWN5k4QJY= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973 h1:hk4LPqXIY/c9XzRbe7dA6qQxaT6Axcbny0L/G5a4owQ= github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973/go.mod h1:PoK3ejP3LJkGTzKqRlpvCIFas3ncU02v8zzWDW+g0FY= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jsimonetti/rtnetlink v1.4.2 h1:Df9w9TZ3npHTyDn0Ev9e1uzmN2odmXd0QX+J5GTEn90= github.com/jsimonetti/rtnetlink v1.4.2/go.mod h1:92s6LJdE+1iOrw+F2/RO7LYI2Qd8pPpFNNUYW06gcoM= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lufia/iostat v1.2.1 h1:tnCdZBIglgxD47RyD55kfWQcJMGzO+1QBziSQfesf2k= github.com/lufia/iostat v1.2.1/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/mattn/go-xmlrpc v0.0.3 h1:Y6WEMLEsqs3RviBrAa1/7qmbGB7DVD3brZIbqMbQdGY= github.com/mattn/go-xmlrpc v0.0.3/go.mod h1:mqc2dz7tP5x5BKlCahN/n+hs7OSZKJkS9JsHNBRlrxA= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mdlayher/ethtool v0.1.0 h1:XAWHsmKhyPOo42qq/yTPb0eFBGUKKTR1rE0dVrWVQ0Y= +github.com/mdlayher/ethtool v0.1.0/go.mod h1:fBMLn2UhfRGtcH5ZFjr+6GUiHEjZsItFD7fSn7jbZVQ= github.com/mdlayher/genetlink v1.3.2 h1:KdrNKe+CTu+IbZnm/GVUMXSqBBLqcGpRDa0xkQy56gw= github.com/mdlayher/genetlink v1.3.2/go.mod h1:tcC3pkCrPUGIKKsCsp0B3AdaaKuHtaxoJRz3cc+528o= github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g= @@ -191,66 +66,33 @@ github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= github.com/mdlayher/wifi v0.3.0 h1:ZfS81w/7xTWBJfhM77K0k6m3sJckwoNOoZUwOW34omo= github.com/mdlayher/wifi v0.3.0/go.mod h1:/bdkqKYl+lD4recmQM6bTHxMrEUW70reibTyr93CAd0= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/exporter-toolkit v0.7.2 h1:O7dcXagEAkXNSU6f3uXYqrhIjHArvxVeGAm0YGctino= -github.com/prometheus/exporter-toolkit v0.7.2/go.mod h1:ZUBIj498ePooX9t/2xtDjeQYwvRpiPP2lh5u4iblj2g= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/prometheus-community/go-runit v0.1.0 h1:uTWEj/Fn2RoLdfg/etSqwzgYNOYPrARx1BHUN052tGA= +github.com/prometheus-community/go-runit v0.1.0/go.mod h1:AvJ9Jo3gAFu2lbM4+qfjdpq30FfiLDJZKbQ015u08IQ= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= +github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/exporter-toolkit v0.11.0 h1:yNTsuZ0aNCNFQ3aFTD2uhPOvr4iD7fdBvKPAEGkNf+g= +github.com/prometheus/exporter-toolkit v0.11.0/go.mod h1:BVnENhnNecpwoTLiABx7mrPB/OLRIgN74qlQbV+FK1Q= +github.com/prometheus/procfs v0.14.0 h1:Lw4VdGGoKEZilJsayHf0B+9YgLGREba2C6xr+Fdfq6s= +github.com/prometheus/procfs v0.14.0/go.mod h1:XL+Iwz8k8ZabyZfMFHPiilCniixqQarAy5Mu67pHlNQ= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/safchain/ethtool v0.4.1 h1:S6mEleTADqgynileXoiapt/nKnatyR6bmIHoF+h2ADo= github.com/safchain/ethtool v0.4.1/go.mod h1:XLLnZmy4OCRTkksP/UiMjij96YmIsBfmBQcs7H6tA48= github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 h1:GfSdC6wKfTGcgCS7BtzF5694Amne1pGCSTY252WhlEY= github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a h1:os5OBNhwOwybXZMNLqT96XqtjdTtwRFw2w08uluvNeI= -github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -259,313 +101,49 @@ github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZ github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= +golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +howett.net/plist v1.0.1 h1:37GdZ8tP09Q35o9ych3ehygcsL+HqKSwzctveSlarvM= +howett.net/plist v1.0.1/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= diff --git a/node_exporter.go b/node_exporter.go index 1ee7284999..a48c3df2bf 100644 --- a/node_exporter.go +++ b/node_exporter.go @@ -20,21 +20,24 @@ import ( _ "net/http/pprof" "os" "os/user" + "runtime" "sort" "github.com/prometheus/common/promlog" "github.com/prometheus/common/promlog/flag" - "github.com/go-kit/log" + kingpin "github.com/alecthomas/kingpin/v2" + log "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" promcollectors "github.com/prometheus/client_golang/prometheus/collectors" + versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/version" "github.com/prometheus/exporter-toolkit/web" + "github.com/prometheus/exporter-toolkit/web/kingpinflag" "github.com/prometheus/node_exporter/collector" _ "github.com/prometheus/node_exporter/percona/perconacollector" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) // handler wraps an unfiltered http.Handler but uses a filtered handler, @@ -118,35 +121,43 @@ func (h *handler) innerHandler(filters ...string) (http.Handler, error) { } r := prometheus.NewRegistry() - r.MustRegister(version.NewCollector("node_exporter")) + r.MustRegister(versioncollector.NewCollector("node_exporter")) if err := r.Register(nc); err != nil { return nil, fmt.Errorf("couldn't register node collector: %s", err) } - handler := promhttp.HandlerFor( - prometheus.Gatherers{h.exporterMetricsRegistry, r}, - promhttp.HandlerOpts{ - ErrorLog: stdlog.New(log.NewStdlibAdapter(level.Error(h.logger)), "", 0), - ErrorHandling: promhttp.ContinueOnError, - MaxRequestsInFlight: h.maxRequests, - Registry: h.exporterMetricsRegistry, - }, - ) + + var handler http.Handler if h.includeExporterMetrics { + handler = promhttp.HandlerFor( + prometheus.Gatherers{h.exporterMetricsRegistry, r}, + promhttp.HandlerOpts{ + ErrorLog: stdlog.New(log.NewStdlibAdapter(level.Error(h.logger)), "", 0), + ErrorHandling: promhttp.ContinueOnError, + MaxRequestsInFlight: h.maxRequests, + Registry: h.exporterMetricsRegistry, + }, + ) // Note that we have to use h.exporterMetricsRegistry here to // use the same promhttp metrics for all expositions. handler = promhttp.InstrumentMetricHandler( h.exporterMetricsRegistry, handler, ) + } else { + handler = promhttp.HandlerFor( + r, + promhttp.HandlerOpts{ + ErrorLog: stdlog.New(log.NewStdlibAdapter(level.Error(h.logger)), "", 0), + ErrorHandling: promhttp.ContinueOnError, + MaxRequestsInFlight: h.maxRequests, + }, + ) } + return handler, nil } func main() { var ( - listenAddress = kingpin.Flag( - "web.listen-address", - "Address on which to expose metrics and web interface.", - ).Default(":9100").String() metricsPath = kingpin.Flag( "web.telemetry-path", "Path under which to expose metrics.", @@ -163,10 +174,10 @@ func main() { "collector.disable-defaults", "Set all collectors to disabled by default.", ).Default("false").Bool() - configFile = kingpin.Flag( - "web.config", - "[EXPERIMENTAL] Path to config yaml file that can enable TLS or authentication.", - ).Default("").String() + maxProcs = kingpin.Flag( + "runtime.gomaxprocs", "The target number of CPUs Go will run on (GOMAXPROCS)", + ).Envar("GOMAXPROCS").Default("1").Int() + toolkitFlags = kingpinflag.AddFlags(kingpin.CommandLine, ":9100") ) promlogConfig := &promlog.Config{} @@ -185,21 +196,32 @@ func main() { if user, err := user.Current(); err == nil && user.Uid == "0" { level.Warn(logger).Log("msg", "Node Exporter is running as root user. This exporter is designed to run as unprivileged user, root is not required.") } + runtime.GOMAXPROCS(*maxProcs) + level.Debug(logger).Log("msg", "Go MAXPROCS", "procs", runtime.GOMAXPROCS(0)) http.Handle(*metricsPath, newHandler(!*disableExporterMetrics, *maxRequests, logger)) - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(` - Node Exporter - -

Node Exporter

-

Metrics

- - `)) - }) - - level.Info(logger).Log("msg", "Listening on", "address", *listenAddress) - server := &http.Server{Addr: *listenAddress} - if err := web.ListenAndServe(server, *configFile, logger); err != nil { + if *metricsPath != "/" { + landingConfig := web.LandingConfig{ + Name: "Node Exporter", + Description: "Prometheus Node Exporter", + Version: version.Info(), + Links: []web.LandingLinks{ + { + Address: *metricsPath, + Text: "Metrics", + }, + }, + } + landingPage, err := web.NewLandingPage(landingConfig) + if err != nil { + level.Error(logger).Log("err", err) + os.Exit(1) + } + http.Handle("/", landingPage) + } + + server := &http.Server{} + if err := web.ListenAndServe(server, toolkitFlags, logger); err != nil { level.Error(logger).Log("err", err) os.Exit(1) } diff --git a/percona/perconacollector/textfile.directory.go b/percona/perconacollector/textfile.directory.go index d04fc199a9..4dfddb4a2c 100644 --- a/percona/perconacollector/textfile.directory.go +++ b/percona/perconacollector/textfile.directory.go @@ -18,20 +18,19 @@ package perconacollector import ( "fmt" - "io/ioutil" "os" "path/filepath" "sort" "strings" "time" - "github.com/go-kit/log" + kingpin "github.com/alecthomas/kingpin/v2" + log "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" cl "github.com/prometheus/node_exporter/collector" - kingpin "gopkg.in/alecthomas/kingpin.v2" ) var ( @@ -235,13 +234,13 @@ func (c *textFileCollector) Update(ch chan<- prometheus.Metric) error { paths, err := filepath.Glob(c.path) if err != nil || len(paths) == 0 { // not glob or not accessible path either way assume single - // directory and let ioutil.ReadDir handle it + // directory and let os.ReadDir handle it paths = []string{c.path} } mtimes := make(map[string]time.Time) for _, path := range paths { - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil && path != "" { errored = true level.Error(c.logger).Log("msg", "failed to read textfile collector directory", "path", path, "err", err) diff --git a/percona/tests/upstream_update/env_prepare_test.go b/percona/tests/upstream_update/env_prepare_test.go index 0948e7ecc1..1140816e6f 100644 --- a/percona/tests/upstream_update/env_prepare_test.go +++ b/percona/tests/upstream_update/env_prepare_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 The Prometheus Authors +// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at diff --git a/percona/tests/upstream_update/metrics_test.go b/percona/tests/upstream_update/metrics_test.go index b295b23a08..34c224e15b 100644 --- a/percona/tests/upstream_update/metrics_test.go +++ b/percona/tests/upstream_update/metrics_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 The Prometheus Authors +// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -20,8 +20,6 @@ import ( "sort" "strings" "testing" - - "github.com/pkg/errors" ) var dumpMetricsFlag = flag.Bool("dumpMetrics", false, "") @@ -508,17 +506,17 @@ func getMetrics(fileName string) (string, error) { func getMetricsFrom(fileName, endpoint string) (string, error) { cmd, port, collectOutput, err := launchExporter(fileName) if err != nil { - return "", errors.Wrap(err, "Failed to launch exporter") + return "", fmt.Errorf("failed to launch exporter: %w", err) } metrics, err := tryGetMetricsFrom(port, endpoint) if err != nil { - return "", errors.Wrap(err, "Failed to get metrics") + return "", fmt.Errorf("failed to get metrics: %w", err) } err = stopExporter(cmd, collectOutput) if err != nil { - return "", errors.Wrap(err, "Failed to stop exporter") + return "", fmt.Errorf("failed to stop exporter: %w", err) } return metrics, nil diff --git a/percona/tests/upstream_update/performance_test.go b/percona/tests/upstream_update/performance_test.go index 3b40a980e8..21b1a0fbd1 100644 --- a/percona/tests/upstream_update/performance_test.go +++ b/percona/tests/upstream_update/performance_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 The Prometheus Authors +// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -16,14 +16,13 @@ package perconatests import ( "flag" "fmt" - "io/ioutil" + "os" "strconv" "strings" "testing" "time" "github.com/montanaflynn/stats" - "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/tklauser/go-sysconf" ) @@ -146,7 +145,7 @@ func doTest(iterations int, fileName string) (cpu, hwm, data int64, _ error) { for i := 0; i < iterations; i++ { _, err = tryGetMetrics(port) if err != nil { - return 0, 0, 0, errors.Wrapf(err, "Failed to perform test iteration %d.%s", i, collectOutput()) + return 0, 0, 0, fmt.Errorf("failed to perform test iteration %d.%s: %w", i, collectOutput(), err) } time.Sleep(1 * time.Millisecond) @@ -165,7 +164,7 @@ func doTest(iterations int, fileName string) (cpu, hwm, data int64, _ error) { } func getCPUMem(pid int) (hwm, data int64) { - contents, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/status", pid)) + contents, err := os.ReadFile(fmt.Sprintf("/proc/%d/status", pid)) if err != nil { return 0, 0 } @@ -189,7 +188,7 @@ func getCPUMem(pid int) (hwm, data int64) { } func getCPUTime(pid int) (total int64) { - contents, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) + contents, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid)) if err != nil { return } diff --git a/percona/tests/upstream_update/utils_test.go b/percona/tests/upstream_update/utils_test.go index 166489381f..3dda5617a7 100644 --- a/percona/tests/upstream_update/utils_test.go +++ b/percona/tests/upstream_update/utils_test.go @@ -1,4 +1,4 @@ -// Copyright 2017 The Prometheus Authors +// Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -25,7 +25,6 @@ import ( "strings" "time" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) @@ -46,7 +45,7 @@ func getBool(val *bool) bool { func launchExporter(fileName string) (cmd *exec.Cmd, port int, collectOutput func() string, _ error) { lines, err := os.ReadFile("assets/test.exporter-flags.txt") if err != nil { - return nil, 0, nil, errors.Wrapf(err, "Unable to read exporter args file") + return nil, 0, nil, fmt.Errorf("unable to read exporter args file: %w", err) } port = -1 @@ -58,7 +57,7 @@ func launchExporter(fileName string) (cmd *exec.Cmd, port int, collectOutput fun } if port == -1 { - return nil, 0, nil, errors.Wrapf(err, "Failed to find free port in range [%d..%d]", portRangeStart, portRangeEnd) + return nil, 0, nil, fmt.Errorf("failed to find free port in range [%d..%d]: %w", portRangeStart, portRangeEnd, err) } linesStr := string(lines) @@ -97,12 +96,12 @@ func launchExporter(fileName string) (cmd *exec.Cmd, port int, collectOutput fun err = cmd.Start() if err != nil { - return nil, 0, nil, errors.Wrapf(err, "Failed to start exporter.%s", collectOutput()) + return nil, 0, nil, fmt.Errorf("failed to start exporter. %w. %s", err, collectOutput()) } err = waitForExporter(port) if err != nil { - return nil, 0, nil, errors.Wrapf(err, "Failed to wait for exporter.%s", collectOutput()) + return nil, 0, nil, fmt.Errorf("failed to wait for exporter. %w. %s", err, collectOutput()) } return cmd, port, collectOutput, nil @@ -111,12 +110,12 @@ func launchExporter(fileName string) (cmd *exec.Cmd, port int, collectOutput fun func stopExporter(cmd *exec.Cmd, collectOutput func() string) error { err := cmd.Process.Signal(unix.SIGINT) if err != nil { - return errors.Wrapf(err, "failed to send SIGINT to exporter process.%s", collectOutput()) + return fmt.Errorf("failed to send SIGINT to exporter process. %w. %s", err, collectOutput()) } err = cmd.Wait() if err != nil && err.Error() != "signal: interrupt" { - return errors.Wrapf(err, "failed to wait for exporter process termination.%s", collectOutput()) + return fmt.Errorf("failed to wait for exporter process termination. %w. %s", err, collectOutput()) } return nil diff --git a/scripts/codespell_ignore.txt b/scripts/codespell_ignore.txt deleted file mode 100644 index 6dd739e590..0000000000 --- a/scripts/codespell_ignore.txt +++ /dev/null @@ -1,9 +0,0 @@ -inflight -packages\' -ro -siz -uint -uptodate -datas -mis -bootup \ No newline at end of file diff --git a/scripts/errcheck_excludes.txt b/scripts/errcheck_excludes.txt deleted file mode 100644 index 14b824f85f..0000000000 --- a/scripts/errcheck_excludes.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Used in HTTP handlers, any error is handled by the server itself. -(net/http.ResponseWriter).Write -// Never check for logger errors. -(github.com/go-kit/log.Logger).Log diff --git a/ttar b/ttar index b0171a12b5..e6cade7614 100755 --- a/ttar +++ b/ttar @@ -212,16 +212,16 @@ function extract { local eof_without_newline if [ "$size" -gt 0 ]; then if [[ "$line" =~ [^\\]EOF ]]; then - # An EOF not preceeded by a backslash indicates that the line + # An EOF not preceded by a backslash indicates that the line # does not end with a newline eof_without_newline=1 else eof_without_newline=0 fi # Replace NULLBYTE with null byte if at beginning of line - # Replace NULLBYTE with null byte unless preceeded by backslash + # Replace NULLBYTE with null byte unless preceded by backslash # Remove one backslash in front of NULLBYTE (if any) - # Remove EOF unless preceeded by backslash + # Remove EOF unless preceded by backslash # Remove one backslash in front of EOF if [ $USE_PYTHON -eq 1 ]; then echo -n "$line" | python -c "$PYTHON_EXTRACT_FILTER" >> "$path"