Repository navigation
CLOS-9230: Sync CloudLinux node_exporter with upstream while preserving Unix socket support - #9
Conversation
…ers (prometheus#3573) The statistics counters of a disabled FC host cannot be read from sysfs and any read attempt fails with errno ENOENT. Therefore, all statistics counters returned by procfs are nil in such a case. This results in a crash on s390x Linux when a zFCP host is disabled with `chzdev -d <host id>`. Crash stacktrace in a GDB ------------------------- $ gdb /root/node_exporter/node_exporter ... Thread 4 "node_exporter" received signal SIGSEGV, Segmentation fault. [Switching to LWP 35579] 0x00000000007be86c in github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update (c=0xc00012fef0, ch=0xc0002fc8c0, ~r0=...) at /root/node_exporter/collector/fibrechannel_linux.go:133 133 c.pushCounter(ch, "dumped_frames_total", *host.Counters.DumpedFrames, *host.Name) (gdb) bt at /root/node_exporter/collector/fibrechannel_linux.go:133 (gdb) p host $1 = {Name = 0xc00038faf0, Speed = 0xc00038fb00, PortState = 0xc00038fb10, PortType = 0xc00038fb30, SymbolicName = 0xc00038fba0, NodeName = 0xc00038fb40, PortID = 0xc00038fb50, PortName = 0xc00038fb60, FabricName = 0xc00038fb80, DevLossTMO = 0xc00038fb90, SupportedClasses = 0xc00038fbb0, SupportedSpeeds = 0xc00038fbd0, Counters = 0xc0001cb2d0} (gdb) p host.Name $2 = (string *) 0xc00038faf0 (gdb) p *host.Name $3 = "host0" (gdb) p *host.Counters.DumpedFrames ❌️ Cannot access memory at address 0x0 (gdb) p *host.Counters $4 = {DumpedFrames = 0x0, ErrorFrames = 0x0, InvalidCRCCount = 0x0, RXFrames = 0x0, RXWords = 0x0, TXFrames = 0x0, TXWords = 0x0, SecondsSinceLastReset = 0x0, InvalidTXWordCount = 0x0, LinkFailureCount = 0x0, LossOfSyncCount = 0x0, LossOfSignalCount = 0x0, NosCount = 0x0, FCPPacketAborts = 0x0} (gdb) bt at /root/node_exporter/collector/fibrechannel_linux.go:133 name="fibrechannel", c=..., ch=0xc0002fc8c0, logger=0xc0002104a0) at /root/node_exporter/collector/collector.go:160 (gdb) p *host.Counters $5 = {DumpedFrames = 0x0, ErrorFrames = 0x0, InvalidCRCCount = 0x0, RXFrames = 0x0, RXWords = 0x0, TXFrames = 0x0, TXWords = 0x0, SecondsSinceLastReset = 0x0, InvalidTXWordCount = 0x0, LinkFailureCount = 0x0, LossOfSyncCount = 0x0, LossOfSignalCount = 0x0, NosCount = 0x0, FCPPacketAborts = 0x0} (gdb) Signed-off-by: Alexander Egorenkov <eaibmz@gmail.com>
Bumps the promci group with 2 updates: [prometheus/promci/publish_main](https://github.com/prometheus/promci) and [prometheus/promci/publish_release](https://github.com/prometheus/promci). Updates `prometheus/promci/publish_main` from 0.8.5 to 0.9.0 - [Release notes](https://github.com/prometheus/promci/releases) - [Commits](prometheus/promci@1394141...370e8c1) Updates `prometheus/promci/publish_release` from 0.8.5 to 0.9.0 - [Release notes](https://github.com/prometheus/promci/releases) - [Commits](prometheus/promci@1394141...370e8c1) --- updated-dependencies: - dependency-name: prometheus/promci/publish_main dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: promci - dependency-name: prometheus/promci/publish_release dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: promci ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.4.0 to 6.5.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@4a36011...924ae3a) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 6.5.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#3744) Bumps [vmactions/netbsd-vm](https://github.com/vmactions/netbsd-vm) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/vmactions/netbsd-vm/releases) - [Commits](vmactions/netbsd-vm@1d97677...0c26a4c) --- updated-dependencies: - dependency-name: vmactions/netbsd-vm dependency-version: 1.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@df4cb1c...9c091bb) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…etheus#3743) Bumps [vmactions/dragonflybsd-vm](https://github.com/vmactions/dragonflybsd-vm) from 1.2.9 to 1.3.1. - [Release notes](https://github.com/vmactions/dragonflybsd-vm/releases) - [Commits](vmactions/dragonflybsd-vm@b446842...bc8ccba) --- updated-dependencies: - dependency-name: vmactions/dragonflybsd-vm dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Expose /sys/kernel/mm/ksm/general_profit as node_ksmd_general_profit_bytes. This file (available since Linux 6.4, EL9) reports the net memory saved by KSM after subtracting the overhead of rmap_item tracking structures. Also gracefully skip any missing sysfs files instead of failing the entire collector, since general_profit and potentially other files may not exist on older kernels. Assisted-by: claude-4.6-opus Signed-off-by: Michal Skrivanek <michal.skrivanek@redhat.com>
Update the ksmd collector to use pre-defined metrics descriptions instead of auto-generated. This allows for improved help text taken from the kernel documentation. This also avoids memory allocations each time `NewKsmdCollector()` is called. Signed-off-by: Ben Kochie <superq@gmail.com>
Bumps the prometheus group with 2 updates: [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) and [github.com/prometheus/common](https://github.com/prometheus/common). Updates `github.com/prometheus/client_golang` from 1.23.2 to 1.24.1 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/v1.24.1/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.23.2...v1.24.1) Updates `github.com/prometheus/common` from 0.70.0 to 0.70.1 - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.70.0...v0.70.1) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-version: 1.24.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: prometheus - dependency-name: github.com/prometheus/common dependency-version: 0.70.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: prometheus ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…theus#3781) Bumps [github.com/mdlayher/wifi](https://github.com/mdlayher/wifi) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/mdlayher/wifi/releases) - [Commits](mdlayher/wifi@v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: github.com/mdlayher/wifi dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#3772) Bumps [vmactions/netbsd-vm](https://github.com/vmactions/netbsd-vm) from 1.4.2 to 1.4.5. - [Release notes](https://github.com/vmactions/netbsd-vm/releases) - [Commits](vmactions/netbsd-vm@0c26a4c...e7ac71b) --- updated-dependencies: - dependency-name: vmactions/netbsd-vm dependency-version: 1.4.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.5.0 to 7.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@924ae3a...b7ad1da) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@9c091bb...3d3c42e) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
Seen on a master node: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x106cefa4] goroutine 81 [running]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0x7e28c1ae20f0, 0x7e28c1826770) /go/src/github.com/prometheus/node_exporter/collector/fibrechannel_linux.go:133 +0x604 sh-5.1# ls -l /host/sys/class/fc_host/ total 0 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host1 -> ../../devices/vio/30000003/host1/fc_host/host1 lrwxrwxrwx. 1 root root 0 Jul 30 20:42 host2 -> ../../devices/vio/30000005/host2/fc_host/host2 sh-5.1# ls -l /host/sys/class/fc_host/host1/ total 0 -rw-r--r--. 1 root root 65536 Jul 30 20:09 dev_loss_tmo lrwxrwxrwx. 1 root root 0 Jul 30 20:42 device -> ../../../host1 -r--r--r--. 1 root root 65536 Jul 30 20:09 fabric_name --w-------. 1 root root 65536 Jul 30 20:42 issue_lip -r--r--r--. 1 root root 65536 Jul 30 20:42 maxframe_size -r--r--r--. 1 root root 65536 Jul 30 20:09 node_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_id -r--r--r--. 1 root root 65536 Jul 30 20:42 port_name -r--r--r--. 1 root root 65536 Jul 30 20:09 port_state -r--r--r--. 1 root root 65536 Jul 30 20:09 port_type drwxr-xr-x. 2 root root 0 Jul 30 20:42 power -r--r--r--. 1 root root 65536 Jul 30 20:09 speed lrwxrwxrwx. 1 root root 0 Jul 30 20:42 subsystem -> ../../../../../../class/fc_host -r--r--r--. 1 root root 65536 Jul 30 20:09 supported_classes -rw-r--r--. 1 root root 65536 Jul 30 20:42 tgtid_bind_type -rw-r--r--. 1 root root 65536 Jul 30 20:42 uevent ``` Since many filenames for counters are not guaranteed to exist in VMs, allocate if not present. Signed-off-by: Mark Hamzy <hamzy@us.ibm.com>
* Extend DRM labels Signed-off-by: Deezzir <deezzir@gmail.com> * chore: move `cleanMetricName` to a shared helper file Signed-off-by: Deezzir <deezzir@gmail.com> --------- Signed-off-by: Deezzir <deezzir@gmail.com>
* [CHORE] adding agents.md Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com> * Address review feedback: link naming conventions, note procfs usage Signed-off-by: Nicolas Takashi <nicolas.takashi@dash0.com> * Trim AGENTS.md per review: drop directory-listing sections, keep non-inferable rules Signed-off-by: Nicolas Takashi <nicolas.takashi@dash0.com> --------- Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com> Signed-off-by: Nicolas Takashi <nicolas.takashi@dash0.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
…s#3776) Bumps [vmactions/openbsd-vm](https://github.com/vmactions/openbsd-vm) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/vmactions/openbsd-vm/releases) - [Commits](vmactions/openbsd-vm@18edb32...c941015) --- updated-dependencies: - dependency-name: vmactions/openbsd-vm dependency-version: 1.4.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s#3774) Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.3.7 to 1.3.8. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](vmactions/solaris-vm@d30dd6c...315163f) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.3.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: USJUN <u.s.junn@gmail.com>
The Debug call added in prometheus#3734 passes printf verbs and positional arguments to slog, which does not format them. The format string is logged verbatim and the arguments are consumed as key/value pairs, so controller and channel numbers become attribute keys: a duplicate key when the two are equal, and otherwise a key whose name changes on every iteration. Under --log.format=json that is an object with a repeated key, and parsers silently drop one of the values. The csrow number and the error, the two things worth reading, are the only parts that survive, and they appear as values of meaningless keys. %w compounds it: that is an fmt.Errorf directive and not a valid Printf verb, left behind when the error return this replaced was converted to a log line. Pass the values as named attributes instead. Metric output is unchanged. Signed-off-by: Adam Butler <github@at-blacknight.com>
Refactor node_exporter's entrypoint to build its configuration and run via the exporter-toolkit bootstrap runner, as groundwork for making node_exporter easier to embed outside the standalone binary. Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
Both cpu_linux and cpufreq export cpu frequencies under the same name. This makes the metric mutually exclusive. A previous PR made it possible to enable both which can cause flapping help texts. This PR re-introduces mutual-exclusive behavior for the frequencies. A new flag `collector.cpufreq.enable-cpufreq-prefix` can be used to migrate all cpufreq metrics to node_cpufreq to avoid the collision. Signed-off-by: René Treffer <treffer@measite.de>
Signed-off-by: jcj46548-ux <jcj46548@gmail.com> Co-authored-by: Ben Kochie <superq@gmail.com>
) * netstat: Use procfs parsers for netstat, snmp and snmp6 Replace the hand-written parsers for /proc/net/netstat, /proc/net/snmp and /proc/net/snmp6 with the parsers from prometheus/procfs (Proc.Netstat, Proc.Snmp and Proc.Snmp6). The statistics are read via /proc/self/net, which is equivalent to /proc/net (both are network-namespace local views of the current process), so the collected data is unchanged. Metrics are exposed by iterating the procfs statistics structs, the same approach the NFS collector uses: fields are *float64 and only the ones present on the system are exported, matching the previous behavior. The --collector.netstat.fields flag and the exported metric names are unchanged; the e2e golden output is identical. Signed-off-by: neoLsH <43921685+neoLsH@users.noreply.github.com> * netstat: use explicit package-level metric descriptors Replace the per-scrape prometheus.NewDesc calls with a pre-built map of explicit descriptors (netstat_descs_linux.go, generated from the procfs statistics structs), as requested in review. Collection still reflects over the procfs structs but looks up the descriptor by "<protocol>_<field>", so descriptors are allocated once and are source-visible literals for the AST-based doc generation. Metric names, help strings and types are unchanged. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com> * Bump procfs to v0.22.0 to populate legacy TcpExt descriptors procfs v0.22.0 includes prometheus/procfs#863, which models the 10 legacy TcpExt counters. With this bump, the explicit descriptors already present in netstat_descs_linux.go start populating for users whose field regex selects them, restoring parity with older kernels. Part of prometheus#3796. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com> * Add generator and drift test for the netstat descriptor table netstat_descs_linux.go was previously committed without its generator. Add an in-repo generator (netstat_descs_gen.go, a build-ignored program run via GOOS=linux go generate ./collector) that regenerates the explicit descriptor table from the procfs structs, mirroring the go:generate pattern used elsewhere in the Prometheus ecosystem. Add TestNetStatDescsInSync, a drift test that fails if the committed table diverges from the procfs structs (e.g. after a procfs upgrade) until the table is regenerated. Part of prometheus#3796. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com> --------- Signed-off-by: neoLsH <43921685+neoLsH@users.noreply.github.com> Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
* fix(e2e): resolve the Darwin fixture path on bash 3.2
The per-OS fixture path was built with "${fixture_metrics::-4}". A
negative substring length needs bash 4.2, and macOS still ships bash 3.2,
where the expansion fails, fixture_metrics keeps pointing at the Linux
fixture, and ./end-to-end-test.sh -u run on a Mac overwrites
collector/fixtures/e2e-output.txt with Darwin output.
"${fixture_metrics%.txt}" is equivalent and works on both.
Also strip node_thermal_temperature_celsius along with the other
non-deterministic metrics. Its sensor names and values are per-machine,
so a developer running the suite on real hardware sees the whole sensor
list as a diff. The CI runner reports no thermal sensors, so this makes
no difference there.
Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
* Apply suggestion from @SuperQ
Signed-off-by: Ben Kochie <superq@gmail.com>
---------
Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
…s#3880) Bumps [vmactions/openbsd-vm](https://github.com/vmactions/openbsd-vm) from 1.4.5 to 1.4.9. - [Release notes](https://github.com/vmactions/openbsd-vm/releases) - [Commits](vmactions/openbsd-vm@c941015...f1ca8bc) --- updated-dependencies: - dependency-name: vmactions/openbsd-vm dependency-version: 1.4.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s#3877) Bumps [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) from 1.5.8 to 1.5.9. - [Release notes](https://github.com/vmactions/freebsd-vm/releases) - [Commits](vmactions/freebsd-vm@a2f9a41...c46abac) --- updated-dependencies: - dependency-name: vmactions/freebsd-vm dependency-version: 1.5.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(infiniband): skip sysfs reads for excluded devices Motivation: --collector.infiniband.device-exclude (and device-include) correctly filtered excluded devices out of emitted metrics, but the collector's Update() called sysfs.FS.InfiniBandClass(), which eagerly parses every device under /sys/class/infiniband -- including reading each port's counter files -- before the device filter is ever applied. On hosts with firmware-managed restricted ports, reading those counter files can trigger a firmware command that fails and floods the kernel log, even though the offending device was explicitly excluded. Approach: Enumerate device names first via sysfs.FS.InfiniBandClassDevices(), which only lists directory entries and performs no attribute or counter reads. Apply the existing device filter against the name, and only call sysfs.FS.InfiniBandDevice(name) -- which does the actual sysfs reads -- for devices that pass the filter. This does not change emitted metrics for included devices; it only avoids touching excluded devices' sysfs files at all. Validation: Added TestInfiniBandCollectorSkipsSysfsReadsForExcludedDevices, which builds a synthetic sysfs tree with a healthy device and a device missing its required fw_ver file (simulating a device whose attributes/counters cannot be read), then excludes the broken device via device-exclude and asserts Update() succeeds and only the included device's metrics are emitted. Report: prometheus#3823 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Assisted-by: claude-sonnet-5 (via Claude Code) --------- Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Signed-off-by: Ben Kochie <superq@gmail.com> Co-authored-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Co-authored-by: Ben Kochie <superq@gmail.com>
…s#3879) Bumps [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/vmactions/solaris-vm/releases) - [Commits](vmactions/solaris-vm@87d3c43...1c16697) --- updated-dependencies: - dependency-name: vmactions/solaris-vm dependency-version: 1.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…etheus#3878) Bumps [github.com/godbus/dbus/v5](https://github.com/godbus/dbus) from 5.2.2 to 5.2.4. - [Release notes](https://github.com/godbus/dbus/releases) - [Commits](godbus/dbus@v5.2.2...v5.2.4) --- updated-dependencies: - dependency-name: github.com/godbus/dbus/v5 dependency-version: 5.2.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
<!-- org-infra-maintainers --> Source: fc9efc2ddcb3d8eb88e31982cfb974bdb50300f5 Signed-off-by: prometheus-org-infra[bot] <314372684+prometheus-org-infra[bot]@users.noreply.github.com> Co-authored-by: prometheus-org-infra[bot] <314372684+prometheus-org-infra[bot]@users.noreply.github.com>
Bumps the prometheus group with 1 update: [github.com/prometheus/common](https://github.com/prometheus/common). Updates `github.com/prometheus/common` from 0.72.1 to 0.73.1 - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.72.1...v0.73.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.73.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: prometheus ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ometheus#3897) Bumps [github.com/mdlayher/ethtool](https://github.com/mdlayher/ethtool) from 0.6.1 to 0.7.0. - [Release notes](https://github.com/mdlayher/ethtool/releases) - [Commits](mdlayher/ethtool@v0.6.1...v0.7.0) --- updated-dependencies: - dependency-name: github.com/mdlayher/ethtool dependency-version: 0.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…etheus#3898) Bumps [github.com/mdlayher/wifi](https://github.com/mdlayher/wifi) from 0.9.0 to 0.10.0. - [Release notes](https://github.com/mdlayher/wifi/releases) - [Commits](mdlayher/wifi@v0.9.0...v0.10.0) --- updated-dependencies: - dependency-name: github.com/mdlayher/wifi dependency-version: 0.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* nvme: deprecate nvme_namespace_capacity_bytes This metric is currently just a duplicate of namespace_size_bytes, as seen in procfs: https://github.com/prometheus/procfs/blob/98e16a16034c77c1277b41cc21915b70fa4631bc/sysfs/class_nvme.go#L200-L201 This is incorrect because capacity & size (ncap & nsze) have special meanings in nvme protocol. ncap is the max logical blocks allocatable to the namespace. nsze is the total logical blocks in the namespace. for thin provisioned namespace ncap < nsze & the kernel does not currently have an easy way to fetch ncap. if ncap is available in a future kernel the metric can be added back. Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com> * changelog: Note deprecation of nvme_namespace_capacity_bytes Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com> --------- Signed-off-by: scarlet-storm <12461256+scarlet-storm@users.noreply.github.com>
* fix(ksmd): parse general_profit as a signed value The kernel prints /sys/kernel/mm/ksm/general_profit as a signed long, and it is negative when KSM costs more memory than it saves. It was read with ParseUint like the other files, so a negative value made Update return an error and drop every ksmd metric after full_scans, failing the collector for that scrape. Read general_profit with ParseInt. Use a negative value in the sys fixture and add a ksmd unit test, and update the e2e output. Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> * ksmd: drop redundant unit test, update 64k-page e2e output The negative general_profit case is covered by the e2e output test, so remove the separate unit test. Update e2e-64k-page-output.txt (used on aarch64 and ppc64le) to match the changed sys fixture. Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> * ksmd: update 64k-page e2e output Signed-off-by: Sanchit2662 <sanchit2662@gmail.com> --------- Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
…3.0 (prometheus#3907) Bumps [github.com/jsimonetti/rtnetlink/v2](https://github.com/jsimonetti/rtnetlink) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/jsimonetti/rtnetlink/releases) - [Commits](jsimonetti/rtnetlink@v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: github.com/jsimonetti/rtnetlink/v2 dependency-version: 2.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the golang-org-x group with 1 update: [golang.org/x/sys](https://github.com/golang/sys). Updates `golang.org/x/sys` from 0.49.0 to 0.50.0 - [Commits](golang/sys@v0.49.0...v0.50.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-version: 0.50.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang-org-x ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The behavior of `node_cpu_frequency_hertz` has changed. There are two different sources of data for this metric. One from the `cpu` collector, one from the `cpufreq` collector. Due to historical feature migrations the `cpufreq` collector shares the same subsystem as the `cpu` collector. This caused conflicting data behavior. An attempt to fix this was introduced in prometheus#3318. This behavior has been reverted to the previous behavior in prometheus#3795. A new flag (`--collector.cpufreq.enable-cpufreq-prefix`) has been introduced that gives the `cpufreq` a dedicated metric name subsystem (`node_cpufreq_...`). This will likely be the default in v2. * [CHANGE] netstat: Use procfs parsers for netstat, snmp and snmp6 prometheus#3796 * [CHANGE] edac: Fix no data results prometheus#3863 * [CHANGE] nvme: Deprecate metric nvme_namespace_capacity_bytes prometheus#3899 * [FEATURE] Add tainted collector for /proc/sys/kernel/tainted prometheus#3745 * [FEATURE] Add resctrl collector prometheus#3797 * [ENHANCEMENT] netstat: Add new FreeBSD metrics prometheus#3334 * [ENHANCEMENT] Add `chip` label to DRM metrics prometheus#3572 * [ENHANCEMENT] diskstats: add device-mapper backing device info metric prometheus#3676 * [ENHANCEMENT] textfile: support UTF-8 metric and label names prometheus#3729 * [ENHANCEMENT] ksmd: add general_profit metric prometheus#3778 prometheus#3894 * [BUGFIX] edac: Fix printf-style formatting in slog call prometheus#3759 * [BUGFIX] fibre_channel: fix crash when attempting to dereference invalid counters prometheus#3573 * [BUGFIX] thermal: Fix collecting Darwin temperatures without CPU power status prometheus#3767 * [BUGFIX] fibrechannel: Fix for ppc64le prometheus#3769 * [BUGFIX] cpu: Revert dup cpu frequency, add node_cpufreq flag prometheus#3795 * [BUGFIX] infiniband: skip sysfs reads for excluded devices prometheus#3824 * [BUGFIX] bcache: Fix btree_read_average_duration_seconds unit prometheus#3828 Signed-off-by: Ben Kochie <superq@gmail.com>
Signed-off-by: prombot <prometheus-team@googlegroups.com>
…texts (prometheus#3866) * textfile: fix panic on a metric without HELP after inconsistent help texts Once a metric has been seen with two different help texts, every later family with the same name is treated as inconsistent. If such a later family has no HELP line, the collector dereferenced its nil help text and panicked. The panic happens in the per-collector goroutine, so it takes down node_exporter. Use the getter for the log line and keep the recorded help text when the new family has none. Signed-off-by: vigneshwar <applemacbook6sep2004@gmail.com> * textfile: move the missing help test into the fixtures Cover the inconsistent help case with a fixture in TestTextfileCollector instead of a separate test that writes files, and drop the extra comment. Signed-off-by: vigneshwar <applemacbook6sep2004@gmail.com> --------- Signed-off-by: vigneshwar <applemacbook6sep2004@gmail.com> Co-authored-by: Ben Kochie <superq@gmail.com>
…eus#3827) While a device is being shrunk, its size is already reduced but the extents beyond it are still allocated, so bytes used exceeds the size and the unsigned subtraction reports ~1.8e19 instead of a negative value. Signed-off-by: Finomosec <1665799+Finomosec@users.noreply.github.com> Co-authored-by: Ben Kochie <superq@gmail.com>
* [BUGFIX] btrfs: Fix device_unused_bytes wrapping around during shrink prometheus#3827 * [BUGFIX] textfile: fix panic on a metric without HELP after inconsistent help texts prometheus#3866 Signed-off-by: Ben Kochie <superq@gmail.com>
Before syncing with upstream (which moves server startup to exporter-toolkit/bootstrap), pin the socket-mode behaviour cl_plus relies on that no test covered yet: - end-to-end-test.sh -s: the socket gets the default 0640 permissions and the exporter process owns no TCP listener. - TestUnixSocket: a non-default --web.socket-permissions is applied, the --web.listen-address passed alongside is not served, SIGTERM exits 0 and removes the socket file. Both pass against the current implementation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
Sync with upstream prometheus/node_exporter v1.13.1 (0192dd8, tag object 88ebf0b): 80 upstream commits since the previous base 156ca7a. Upstream master equals the tag at the time of the merge. Conflict in node_exporter.go: upstream moved the web flags and the server startup into exporter-toolkit's bootstrap.Runner (v0.20.0), which has no unix socket listener and no hook to replace the listener. Resolution: - Flags: keep --web.socket-path and --web.socket-permissions unchanged in main(); drop the web.telemetry-path/disable-exporter-metrics/max-requests declarations, which bootstrap now registers itself. - Startup: keep upstream's bootstrap.New/runner.Run. Wrap runner.MetricsHandlerFactory with unixSocketFactory: bootstrap calls it after flag parsing and before opening listeners. With --web.socket-path set it serves the same routes (metrics with --web.max-requests, landing page, pprof) on the unix socket, chmods it, removes it and exits 0 on SIGINT/SIGTERM, and never returns to bootstrap, so no TCP listener is opened. Without the flag the upstream path is untouched. Design spec and CLAUDE.md record the new mechanism and the upstream base. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
TestDiskStats and TestMdadmStats start collector.Update on a sink that nobody reads, so the goroutine outlives the test. It is still reading the collector path flags when a later test (TestMountPointDetails, TestMemInfo) re-parses kingpin flags, and `go test -race` (what `make test` runs on amd64, including the RPM %build) fails with "race detected during execution of test". On this host with Go 1.27.4, `go test -short -race ./...` failed 8 of 20 runs on unmodified upstream v1.13.1 and 2 of 20 on the previous fork base; with the sink drained it passed 30 of 30. Test-only change to upstream files; drop it once upstream fixes the tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
Upstream v1.13.1 requires Go 1.26.0 (go.mod); the recipes still fetched go1.24.0, with which the go command's default GOTOOLCHAIN=auto would download a newer toolchain from proxy.golang.org on its own (the 1.2.1 binary reports go1.25.0 for that reason). Fetch go1.27.4 from dl.google.com in node_exporter.spec and debian/rules, the latest patch of the Go line upstream builds v1.13.1 with (.promu.yml, CI setup-go). Bump version to 1.2.2-1 in the spec and debian/changelog. Update the packaging design spec: toolchain pin and why, module/promu downloads, and the test coverage table (the RPM build does not run test-e2e; QA runs it on the installed tests subpackage). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
Upstream v1.13.0 added node_disk_device_mapper_backing_device_info; its e2e fixtures list sys/block/dm-*/slaves/* entries that are dangling symlinks (the collector only reads their names). The spec deleted every dangling symlink under the shipped fixtures, so the installed /opt/node_exporter_tests/end-to-end-test.sh failed in both modes with five missing series. Keep the slaves/ links in the RPM. Verified with a local rpmbuild on CL9: the package builds, and both ./end-to-end-test.sh and ./end-to-end-test.sh -s run from the extracted tests subpackage exit 0 with no output (they failed before this change). debian/rules is unchanged: its blanket removal was added because dh failed on dangling symlinks, and QA does not run the e2e on Ubuntu. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
…ts package The deb tests package lost fixture data the e2e harness reads: debian/rules deleted every dangling symlink, including the sys/block/dm-*/slaves/* links upstream v1.13.0 added, and dh_movefiles moves only files and symlinks, so empty fixture directories such as sys/block/dm-5/slaves/sd* were dropped. end-to-end-test.sh on the installed debs (Ubuntu 22.04) failed in TCP and unix-socket mode on node_disk_device_mapper_backing_device_info and node_dmmultipath_*. Keep the slaves links like the RPM spec does and create the empty fixture directories in the tests package. With both, the deb e2e passes in both modes. debhelper 13.6 builds the package with the links kept. The packaging design spec now describes this and lists diff among the tools the e2e harness needs on the test host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
…g links
QA's 0_integrity_check.bats ("symlinks are correct and exists") fails
any package that contains a symlink to a missing target. Since 2becbe3
the tests package shipped none, but keeping the five
sys/block/dm-{0..4}/slaves/* links (b22df28 for the RPM, cad2ef4 for
the deb) made that gate fail for cl-node-exporter-tests on every target.
The diskstats collector only reads the entry names in slaves/ (procfs
SysBlockDeviceUnderlyingDevices uses Readdirnames), so both recipes now
turn those dangling links into empty regular files of the same name and
delete every other dangling link as before. The package again has no
dangling symlinks and the e2e output still has the five
node_disk_device_mapper_backing_device_info series.
The packaging design spec records the no-dangling-symlink invariant and
the QA gate that enforces it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG
Worked-On: cl-aiworkspaces
|
Review at fe090f5: the merge and the socket transport look good. CLBS 6b04531a (latest test run) has 0 failures on CL7–CL10 and Ubuntu 22, and centralized-management pipeline 806521 is 6/6 green. Locally, socket mode with cl_plus's command line behaves the same as 1.2.1, and 1. lint (gofumpt): 2. The new
Suggested change (checked locally: diff --git a/end-to-end-test.sh b/end-to-end-test.sh
index 1e39e7ea..97e09c3c 100755
--- a/end-to-end-test.sh
+++ b/end-to-end-test.sh
@@ -375,16 +375,22 @@ sleep 1
if [ ${socket} -ne 0 ]; then
# The default --web.socket-permissions (0640, what cl_plus runs with) is
# applied to the socket file.
- socket_mode=$(stat -c '%a' "${unix_socket}")
+ # GNU stat (Linux, Solaris) or BSD/macOS stat.
+ socket_mode=$(stat -c '%a' "${unix_socket}" 2>/dev/null || stat -f '%Lp' "${unix_socket}")
if [ "${socket_mode}" != "640" ]; then
echo "Unix socket has permissions ${socket_mode}, want 640"
exit 1
fi
- # No TCP listener is opened in unix socket mode.
- tcp_listeners=$(ss -ltnp)
- if grep -q "pid=$(cat "${tmpdir}/node_exporter.pid")," <<< "${tcp_listeners}"; then
- echo "Node exporter opened a TCP listener in unix socket mode"
- exit 1
+ # No TCP listener is opened in unix socket mode (ss is Linux-only; on other
+ # hosts TestUnixSocket covers this).
+ if command -v ss > /dev/null 2>&1; then
+ tcp_listeners=$(ss -ltnp)
+ if grep -q "pid=$(cat "${tmpdir}/node_exporter.pid")," <<< "${tcp_listeners}"; then
+ echo "Node exporter opened a TCP listener in unix socket mode"
+ exit 1
+ fi
+ else
+ echo "ss not found, skipping the TCP listener check" >&2
fi
fi
diff --git a/node_exporter_test.go b/node_exporter_test.go
index 39a78321..eaa6337c 100644
--- a/node_exporter_test.go
+++ b/node_exporter_test.go
@@ -137,7 +137,7 @@ func TestUnixSocket(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if fi.Mode()&os.ModeSocket == 0 || fi.Mode().Perm() != 0600 {
+ if fi.Mode()&os.ModeSocket == 0 || fi.Mode().Perm() != 0o600 {
t.Errorf("want a socket with permissions 0600, have %s", fi.Mode())
}
The Darwin job was cancelled because it never got a runner. That isn't caused by this PR, but macOS Please merge this as a merge commit, not a squash, so the upstream history stays. |
The checks added in 5d9a510 broke the upstream workflows on PR cloudlinux#9: `stat -c` is GNU-only (FreeBSD/OpenBSD e2e: "stat: illegal option -- c"), `ss` is missing from the golang-builder CI container and does not exist on the BSDs, Solaris or macOS ("ss: command not found", make Error 127), and gofumpt wants the 0o600 octal literal in TestUnixSocket. end-to-end-test.sh -s keeps asserting the same two invariants with only what the script already needs everywhere it runs: - default permissions: the first 10 characters of `ls -ld` on the socket must be srw-r-----; - no TCP listener: the exporter now also gets the script's own --web.listen-address=127.0.0.1:<port>, and curl to it must fail with exit code 7 (connection refused) while the socket serves metrics. Any other curl result, including a missing curl, fails the run. This is the invariant TestUnixSocket pins; the released 1.2.1 refuses that address in socket mode too. The tests package no longer needs stat or ss on the test host; the packaging spec's dependency list and the socket spec's coverage table are updated. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG Worked-On: cl-aiworkspaces
|
MR is good to merge |
Sync with prometheus/node_exporter v1.13.1 (0192dd8), 80 upstream commits.
Jira: https://cloudlinux.atlassian.net/browse/CLOS-9230
the Unix socket listener is hooked in through the runner's metrics handler
factory. --web.socket-path and --web.socket-permissions are unchanged.
Socket mode opens no TCP listener and removes the socket on SIGINT/SIGTERM.
(TestUnixSocket, end-to-end-test.sh -s).
make test -racefail intermittently.
dm-*/slaves fixture entries as empty files instead of dangling symlinks;
the deb tests package keeps empty fixture directories.
CLAUDE.md.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ByLmoC6vPtQjunkTkv35PG