Commit graph

1022 commits

Author SHA1 Message Date
Ben Kochie 31a9cca551
Update e2e fixtures
Update for fixes in https://github.com/prometheus/procfs/pull/543

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-10-16 13:37:17 +02:00
Conall O'Brien 60c86ab218
Fix inconsistent variable name, to address compilation issue (#2820)
https://github.com/prometheus/node_exporter/issues/2819

Signed-off-by: Conall O'Brien <conall@conall.net>
2023-10-04 21:16:58 +02:00
dongjiang e8c5110ada
fix(zfs) zfs arcstats.p on FreeBSD 14.0+ (#2754)
* dongjiang, fix zfs arcstats.p

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* dongjiang, fix gofmt -s

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* change warn log to debug log by code review

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2023-09-20 11:49:56 +02:00
Metbog e387997e4c Move RO status before error return
Signed-off-by: Metbog <metbog@gmail.com>
2023-09-20 11:26:39 +02:00
Conall O'Brien f34aaa6109
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 <conall@conall.net>
2023-09-11 06:33:21 +02:00
Daniel Swarbrick 685b98ec7f
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 <daniel.swarbrick@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2023-09-09 16:41:09 +02:00
Daniel Swarbrick 381f32b1c5 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 <daniel.swarbrick@gmail.com>
2023-08-21 16:00:00 +02:00
Josh Bradley f2b274350a
fix(qdisc) flag naming corrected for consistency (#2782)
* fix collector qdisc flag naming for consistency

---------

Signed-off-by: jbradleynh <jbradley@fastly.com>
2023-08-21 07:48:09 +02:00
John Kordich e120d958f5 Change log message from Warn to Debug
Signed-off-by: John Kordich <jkordich@gmail.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: John Kordich <jkordich@gmail.com>
2023-08-20 13:38:47 +02:00
John Kordich 933b1c1797 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 <jkordich@gmail.com>
2023-08-20 13:38:47 +02:00
John Kordich e84c278107 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 <jkordich@gmail.com>
2023-08-20 13:38:47 +02:00
John Kordich 223ebbd50c 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 <jkordich@gmail.com>
2023-08-20 13:38:47 +02:00
Daniel Swarbrick 37ce0bab8c
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 <daniel.swarbrick@gmail.com>
2023-08-15 11:38:13 +02:00
Daniel Swarbrick 3fb5f70b0c 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 <daniel.swarbrick@gmail.com>
2023-08-08 14:30:39 +02:00
Benoît Knecht 3b9613cfae
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 <bknecht@protonmail.ch>
2023-08-01 15:58:53 +02:00
PrometheusBot fa481315b5
Synchronize common files from prometheus/prometheus (#2736)
* Update common Prometheus files

Signed-off-by: prombot <prometheus-team@googlegroups.com>

* Fixup linting issues

* Disbale unused-parameter check.
* Fixup minor linting issues.

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

---------

Signed-off-by: prombot <prometheus-team@googlegroups.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2023-07-18 10:46:59 +02:00
Ben Kochie 7c564bcbef
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 <superq@gmail.com>
2023-07-10 12:46:30 +02:00
Conall O'Brien c241ecf8bd
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 <conall@conall.net>
2023-07-10 12:25:18 +02:00
Conall O'Brien 8b4dc82488
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 <conall@conall.net>
Co-authored-by: Ben Kochie <superq@gmail.com>
2023-07-07 10:30:24 +02:00
Michal c31ebb4359
Add cpu vulnerabilities reporting from sysfs (#2721)
* Add cpu vulnerabilities reporting from sysfs

---------

Signed-off-by: Michal Wasilewski <michal@mwasilewski.net>
2023-07-01 14:21:49 +02:00
Cam Cope 2346fd9b06
add missing linkspeeds (#2711)
Signed-off-by: Cam Cope <ccope@crusoeenergy.com>
2023-06-18 09:01:53 +02:00
Erica Mays bdc430af2b 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 <erica@emays.dev>
2023-06-09 12:31:31 +02:00
Dan Williams 8c5847bd94
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 <dcbw@redhat.com>
2023-05-25 15:10:39 +02:00
Abbey Woodyear eaacb2e3c7
exposing softirq metrics (#2294)
Signed-off-by: abbeywoodyear <abbey.woodyear@thehutgroup.com>
2023-05-25 15:09:32 +02:00
Remi Jouannet df1b53bee2
softnet: additionals metrics from softnet_data, (#2592)
* softnet: additionals metrics from softnet_data, https://github.com/prometheus/procfs/pull/473
---------

Signed-off-by: remi <remijouannet@gmail.com>
Signed-off-by: Rémi Jouannet <remijouannet@gmail.com>
2023-05-24 17:23:13 +02:00
Benoît Knecht c05b97ce32
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 <bknecht@protonmail.ch>
2023-05-24 10:19:18 +02:00
Ben Kochie da0b2ca3c2 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 <superq@gmail.com>
2023-05-23 18:10:42 +02:00
dongjiang 1bbb2a94c0
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 <dongjiang1989@126.com>
2023-05-23 11:13:48 +02:00
Ben Kochie 3f64e91b0d
Update Go modules (#2695)
Update Prometheus modules to latest releases.
* Add missing fixtures for cpus online/offline.

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-05-23 06:14:58 +02:00
Ben Kochie d2dd793e39
Update e2e output fixtures (#2696)
Fix up correct e2e output for node_power_supply_info.

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-05-22 17:28:45 +02:00
Sal Sal dcb10ff291
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>
2023-05-20 14:13:07 +02:00
cui fliter 287414bc65
collector: fix comment and remove redundant parentheses (#2691)
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-17 18:04:50 +02:00
Claudio Jeker 184a4e0893
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 <claudio@openbsd.org>
2023-05-11 10:40:38 +02:00
Claudio Jeker 6251cc7b6c
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 <claudio@openbsd.org>
2023-05-11 10:39:51 +02:00
Jonathan Davies 29c97c2197
collector/netisr_freebsd.go: Added collector for netisr subsystem. (#2668)
Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2023-05-11 10:34:26 +02:00
Johannes Ziemke 180879e1c4 Use go-runit fork, mark collector as deprecated
Signed-off-by: Johannes Ziemke <github@5pi.de>
2023-05-09 11:42:21 +02:00
Maximilian Wilhelm c8129fadd6
Expose administrative state of network interfaces as 'adminstate'. (#2515)
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2023-05-02 15:25:05 +02:00
Pablo Caderno d31af1d1e5
feat: added suspended as a node_zfs_zpool_state (#2449)
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
2023-04-26 18:12:54 +02:00
Matthias Petermann b87c6a8826
NetBSD support for CPU collector (#2626)
* Added CPU collector for NetBSD to provide load and temperature statistics

---------

Signed-off-by: Matthias Petermann <mp@petermann-it.de>
2023-04-07 13:35:33 +02:00
Lukas Coppens 1724b28d27 feat: add support for cpu freq governor metrics
Signed-off-by: Lukas Coppens <lukas.coppens@be-mobile.com>
2023-03-10 18:19:33 +01:00
Lukas Coppens fe19fdd1e8 feat: add support for cpu freq governor metrics
Signed-off-by: Lukas Coppens <lukas.coppens@be-mobile.com>
2023-03-10 18:19:33 +01:00
Daniël van Eeden 8d3c594346
interrupts_linux: Fix fields on aarch64 (#2631)
* interrupts_linux: Fix fields on aarch64

Fixes #2557

---------

Signed-off-by: Daniël van Eeden <git@myname.nl>
2023-03-10 13:02:33 +01:00
Ben Kochie 3691cb9faf
Update build
* Update Go to 1.20
* Update golangci-lint.
* Update CI orb.
* Fix staticcheck issue in perf collector.

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-03-08 11:16:10 +01:00
Ben Kochie 2f20a9bb3c
Merge pull request #2603 from prometheus/superq/deprecate_ntp
Deprecate ntp collector
2023-03-07 17:37:19 +01:00
Ben Kochie c23b76bfbb
Update exporter-toolkit
* Bump exporter-toolkit to the latest release.
* Use new toolkit landing page function.
* Update kingpin flags.

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-03-07 15:18:38 +01:00
Haoyu Sun 37d49746bc Remove metrics of offline CPUs in CPU collector
Signed-off-by: Haoyu Sun <hasun@redhat.com>
2023-03-07 14:01:02 +01:00
Ben Kochie c914f00526
Merge pull request #2587 from prometheus/superq/cpufreq_common
Optimize cpufreq collector
2023-02-25 20:18:24 +01:00
Ben Kochie c8705ec4b2
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 <superq@gmail.com>
2023-02-16 09:27:38 +01:00
Ben Kochie 3cd9b163e6
Optimize cpufreq collector
Move metric descriptiions to package vars to avoid allocating them every
time `NewCPUFreqCollector()` is called.

Signed-off-by: Ben Kochie <superq@gmail.com>
2023-01-28 11:42:02 +01:00
David O'Rourke 9232df7237 memory_bsd: Fix a problem fetching the user wire count on FreeBSD
Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2023-01-26 02:55:32 +00:00
Benny Siegert 131ff8a042 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 <bsiegert@gmail.com>
2023-01-23 16:54:35 +00:00
Ben Kochie 2d77d8c562
Update e2e output for new common version.
Signed-off-by: Ben Kochie <superq@gmail.com>
2023-01-20 10:38:19 +01:00
Jia Xin 39b4556b5b fix cpustat when some cpus are offline
Signed-off-by: Jia Xin <alexjx@gmail.com>
2023-01-20 01:24:06 +00:00
Benny Siegert 701912b5e7 Enable uname collector on NetBSD too
This collector works just fine without any further changes.

Signed-off-by: Benny Siegert <bsiegert@gmail.com>
2022-12-31 12:02:00 +01:00
Ben Kochie efa7f24698
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 <superq@gmail.com>
2022-12-22 12:30:20 +01:00
Ben Kochie 4484f18566
Merge pull request #2542 from mchtech/add-perf-profiler-options
Add profiler options for perf collector
2022-12-22 10:29:03 +01:00
jalev 22e5dd2f0d Fix lint issues
Signed-off-by: jalev <qweet.ing@gmail.com>
2022-12-18 14:49:53 +01:00
James Bach a177412d06 Change var name to match previous
Signed-off-by: James Bach <james.bach@wise.com>
Signed-off-by: jalev <qweet.ing@gmail.com>
2022-12-18 14:49:53 +01:00
James Bach 5538773089 Migrate arp_linux.go to procfs
Signed-off-by: James Bach <qweet.ing@gmail.com>
Signed-off-by: James Bach <james.bach@wise.com>
Signed-off-by: jalev <qweet.ing@gmail.com>
2022-12-18 14:49:53 +01:00
mchtech f934f9cb0f add options for perf profilers
Signed-off-by: mchtech <michu_an@126.com>
2022-12-07 12:52:46 +08:00
Ben Kochie 13a5cc1f74
Refactor netclass_rtnl collector (#2528)
* Refactor netclass_rtnl collector

Merge the netclass_rtnl collector into the netclass collector.
* Disabled by default
* Followup to #2492

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-11-29 11:22:25 +01:00
SUN Haoyu bba0e2e557
add RTNL version of netclass collector (#2492)
* update rtnetlink package to v1.2.3
* add RTNL version of netclass collector that have all the metrics that netdev collector provides, too.

Signed-off-by: Haoyu Sun <hasun@redhat.com>
2022-11-21 16:38:04 +01:00
Marcus Cobden 936368d217
Fix btrfs device stats always being zero (#2516)
* Respect rootfs path config option in btrfs ioctl
* Fix btrfs device stats always being zero

Signed-off-by: Marcus Cobden <leth@users.noreply.github.com>
2022-11-08 16:09:39 +01:00
Ben Kochie ba8c043079
Add procfs fallback to netdev collector (#2509)
Some systems have broken netlink messages due to patched kernels. Since
these messages can not be parsed, add a flag to fall back to parsing
from `/proc/net/dev`.

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

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-10-24 10:30:32 +02:00
Daniel Swarbrick 34a498e132
Use native endianness when encoding InetDiagMsg (#2508)
Note however that the InetDiagMsg struct contains a InetDiagSockID
member, which itself contains some members which are explicitly
specified as big-endian in Linux kernel source:

struct inet_diag_sockid {
	__be16	idiag_sport;
	__be16	idiag_dport;
	__be32	idiag_src[4];
	__be32	idiag_dst[4];
	__u32	idiag_if;
	__u32	idiag_cookie[2];
};

node_exporter currently does not use these members for anything, so this
is acceptable (for now).

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
2022-10-22 11:05:47 +02:00
Ben Kochie 98a40bd712
Fix hwmon label sanitizer (#2504)
We don't need to fully sanitize the hwmon label values to metric/label
name strings.
* Just make sure they're valid UTF-8.
* Always included the label metric to avoid group_left failures.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-10-11 14:40:28 +02:00
Ben Kochie d9b2634324
Fix diskstats exclude flags (#2487)
Correctly handle the new `collector.diskstats.device-exclude` flag to
avoid errors when using the old `collector.diskstats.ignored-devices`
flag.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-09-28 15:00:37 +02:00
Darshil Chanpura daba360c93
Archived fixtures/udev similar to fixtures/sys to avoid go-get errors, fixes #2482 (#2485)
Signed-off-by: Darshil Chanpura <darshil@thatwebsite.xyz>
2022-09-27 23:07:57 +02:00
Ben Kochie 7da1321761
Release 1.4.0 (#2478)
* [CHANGE] Merge metrics descriptions in textfile collector #2475
* [FEATURE] [node-mixin] Add darwin dashboard to mixin #2351
* [FEATURE] Add "isolated" metric on cpu collector on linux #2251
* [FEATURE] Add cgroup summary collector #2408
* [FEATURE] Add selinux collector #2205
* [FEATURE] Add slab info collector #2376
* [FEATURE] Add sysctl collector #2425
* [FEATURE] Also track the CPU Spin time for OpenBSD systems #1971
* [FEATURE] Add support for MacOS version #2471
* [ENHANCEMENT] [node-mixin] Add missing selectors #2426
* [ENHANCEMENT] [node-mixin] Change current datasource to grafana's default #2281
* [ENHANCEMENT] [node-mixin] Change disk graph to disk table #2364
* [ENHANCEMENT] [node-mixin] Change io time units to %util #2375
* [ENHANCEMENT] Ad user_wired_bytes and laundry_bytes on *bsd #2266
* [ENHANCEMENT] Add additional vm_stat memory metrics for darwin #2240
* [ENHANCEMENT] Add device filter flags to arp collector #2254
* [ENHANCEMENT] Add diskstats include and exclude device flags #2417
* [ENHANCEMENT] Add node_softirqs_total metric #2221
* [ENHANCEMENT] Add rapl zone name label option #2401
* [ENHANCEMENT] Add slabinfo collector #1799
* [ENHANCEMENT] Allow user to select port on NTP server to query #2270
* [ENHANCEMENT] collector/diskstats: Add labels and metrics from udev #2404
* [ENHANCEMENT] Enable builds against older macOS SDK #2327
* [ENHANCEMENT] qdisk-linux: Add exclude and include flags for interface name #2432
* [ENHANCEMENT] systemd: Expose systemd minor version #2282
* [ENHANCEMENT] Use netlink for tcpstat collector #2322
* [ENHANCEMENT] Use netlink to get netdev stats #2074
* [ENHANCEMENT] Add additional perf counters for stalled frontend/backend cycles #2191
* [ENHANCEMENT] Add btrfs device error stats #2193
* [BUGFIX] [node-mixin] Fix fsSpaceAvailableCriticalThreshold and fsSpaceAvailableWarning #2352
* [BUGFIX] Fix concurrency issue in ethtool collector #2289
* [BUGFIX] Fix concurrency issue in netdev collector #2267
* [BUGFIX] Fix diskstat reads and write metrics for disks with different sector sizes #2311
* [BUGFIX] Fix iostat on macos broken by deprecation warning #2292
* [BUGFIX] Fix NodeFileDescriptorLimit alerts #2340
* [BUGFIX] Sanitize rapl zone names #2299
* [BUGFIX] Add file descriptor close safely in test #2447
* [BUGFIX] Fix race condition in os_release.go #2454
* [BUGFIX] Skip ZFS IO metrics if their paths are missing #2451

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-09-26 14:30:51 +02:00
Marcus Cobden 135710d8b5
Add btrfs device error stats (#2193)
* Improve metrics filesystem scanning logic
* Makes ioctl syscalls to load the device error stats.
* Adds filesystem mountpoint labels to existing metrics for ease of use.

Signed-off-by: Marcus Cobden <leth@users.noreply.github.com>
2022-09-24 08:25:15 +02:00
tnextday d7e89e769d
Skip zfs iostats (#2451)
skip over the zfs IO metrics if their paths are missing

Signed-off-by: tnextday <fw2k4@163.com>

Signed-off-by: tnextday <fw2k4@163.com>
2022-09-22 19:32:31 +02:00
Guillaume E 863f3ac54c
Merge metrics descriptions in textfile collector (#2475)
The textfile collector will now provide a unified metric description
(that will look like "Metric read from file/a.prom, file/b.prom")
for metrics collected accross several text-files that don't already
have a description.

Also change the error handling in the textfile collector tests to
ContinueOnError to better mirror the real-life use-case.

Signed-off-by: Guillaume Espanel <guillaume.espanel.ext@ovhcloud.com>

Signed-off-by: Guillaume Espanel <guillaume.espanel.ext@ovhcloud.com>
2022-09-20 12:49:21 +02:00
sfreydin 31f9aefe2f
feat: add support macos version (#2471)
Signed-off-by: Serhii Freidin <sfreydin@macpaw.com>

Signed-off-by: Serhii Freidin <sfreydin@macpaw.com>
2022-09-16 13:13:06 +02:00
Robin Nabel 8755e852fa Wrap accesses of c.osFilename and c.osMtime in
mutex to prevent race condition.

Signed-off-by: Robin Nabel <rnabel@ucdavis.edu>
2022-09-06 11:37:05 +02:00
Ben Kochie 49db7c81e1
Fixup codespell (#2455)
* Fix some mistakes
* Switch to an ignore file.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-09-02 10:49:47 +02:00
Cosrider 46748fd229 add file descriptor close safely in test
Signed-off-by: Cosrider <cosrider7@gmail.com>
2022-08-22 16:01:02 +02:00
Daniel Hodges b43db0de6e
Add additional perf counters for stalled frontend/backend cycles (#2191)
* Add stalled frontend/backend cycles counters for perf collector

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>

* Update collector/perf_linux.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>

* Update collector/perf_linux.go

Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
2022-08-02 14:42:48 +02:00
inosato 9ed32666cc
Remove ioutil (#2438)
Signed-off-by: inosato <si17_21@yahoo.co.jp>
2022-07-27 20:59:39 +02:00
Andrew Rowson aa1adc7b11
Allow user to select port on NTP server to query (#2270)
* Allow user to select port on NTP server to query

Some people (me!) run NTP servers on non-privileged ports. The `github.com/beevik/ntp` package allows overriding the port, so this change just adds a flag `collector.ntp.server-port` (defaults to 123) and then passes that value through to the query via the `QueryOptions`.

Signed-off-by: Andrew Rowson <github@growse.com>
2022-07-27 15:41:59 +02:00
Ben Kochie 8a688e8903
Merge pull request #2433 from prometheus/superq/fixup_openbsd_date
Fix up copyright date change
2022-07-27 14:30:02 +02:00
binjip978 c38e1e27ca qdisk-linux: Add exclude and include flags for interface name
Signed-off-by: binjip978 <pdp.eleven11@gmail.com>
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2022-07-27 14:15:08 +02:00
Ben Kochie dffe507aad
Fix up copyright date change
Return the copyright date in `collector/cpu_openbsd.go` to the original
value.

Minor change revert on https://github.com/prometheus/node_exporter/pull/1971

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-07-27 14:11:01 +02:00
Ben Kochie 0b82f402d0
Merge pull request #1971 from cjeker/openbsd_spin_time
Also track the CPU Spin time for OpenBSD systems.
2022-07-27 14:10:31 +02:00
Ben Kochie 88a031567f
Merge pull request #2074 from BenoitKnecht/netdev-linux-netlink
collector/netdev_linux.go: Use netlink to get stats
2022-07-27 13:47:01 +02:00
Benoît Knecht b25273fac0 collector/netdev_*: Add detailed interface stats
On Linux, we get more detailed interface statistics from netlink than we did
from `/proc/net/dev`.

This commit adds a new flag (`--collector.netdev.enable-detailed-metrics`) to
expose those statistics under new (incompatible) metric names. When enabled,
the metric names are also changed on Darwin and BSD platforms to keep
everything consistent, but it doesn't provide more detailed statistics on those
platforms.

The old metrics can be derived from the new ones using the following rules
([dev_seq_printf_stats]):

- `receive_errs`      = `receive_errors`
- `receive_drop`      = `receive_dropped` + `receive_missed_errors`
- `receive_fifo`      = `receive_fifo_errors`
- `receive_frame`     = `receive_length_errors` + `receive_over_errors` + `receive_crc_errors` + `receive_frame_errors`
- `receive_multicast` = `multicast`
- `transmit_errs`     = `transmit_errors`
- `transmit_drop`     = `transmit_dropped`
- `transmit_fifo`     = `transmit_fifo_errors`
- `transmit_colls`    = `collisions`
- `transmit_carrier`  = `transmit_aborted_errors` + `transmit_carrier_errors` + `transmit_heartbeat_errors` + `transmit_window_errors`

[dev_seq_printf_stats]: https://github.com/torvalds/linux/blob/master/net/core/net-procfs.c#L75-L97

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-26 13:24:20 +02:00
Benoît Knecht 4851993a63 collector/netdev_linux_test.go: Add compatibility tests
To prepare for the introduction of new metric names, add tests for the legacy
metric names and values. This will make it easier to ensure that the code that
converts the new metrics to the old ones (for compatibility) behaves correctly.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-26 13:24:20 +02:00
Benoît Knecht a71d0bddc8 end-to-end-test.sh: Fix netdev metrics
Since netdev metrics are now read from netlink instead of `/proc/net/dev`, we
can't easily spoof them for the end-to-end tests by reading a fixture file in
place of `/proc/net/dev`.

Therefore, we only get metrics for `lo` and ignore those that would return
unpredictable values (i.e. the byte and packet counters).

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-26 13:24:20 +02:00
Benoît Knecht f23a956c4f collector/netdev_linux.go: Use netlink to get stats
Instead of parsing `/proc/net/dev` to get network interface statistics, get
them from a netlink call.

Internally, both come from the [rtnl_link_stats64] struct, but with
`/proc/net/dev`, some of the values are aggregated together in
[dev_seq_printf_stats], so we get less information out of them.

This commit maintains compatibility by aggregating those stats back into the
same metrics.

[rtnl_link_stats64]:    https://github.com/torvalds/linux/blob/master/include/uapi/linux/if_link.h#L42-L246
[dev_seq_printf_stats]: https://github.com/torvalds/linux/blob/master/net/core/net-procfs.c#L75-L97

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-26 13:09:58 +02:00
DavidVentura 6477a197da adjust expected output for 64k file
Signed-off-by: DavidVentura <davidventura27@gmail.com>
2022-07-26 12:25:23 +02:00
david c2085cf8ca flip branches for early return
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 75c05f3d97 remove error from signature; update doc for function
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 840d32622f check for nil isolatedCpus before calling updateIsolated
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 5340d1ec37 add debug log for not existent file
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david c05af934af warn if isolcpus cannot be read and default to an empty slice
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 9ea9a5f029 only publish metrics for isolated cpus
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 698670bb6e add fixture & e2e output
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 5d68d5b9ad move logic to procfs; create a new metric for isolation
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
david 512e086dec Implement #2250: Add "isolated" label on cpu collector on linux
Signed-off-by: david <davidventura27@gmail.com>
2022-07-26 11:21:08 +02:00
François Charlier 5a2c83d0f9 memory_bsd: add user_wired_bytes & laundry_bytes
These two memory classes have been here for a while now in FreeBSD,
adding them allows having information for all memory classes.

Signed-off-by: François Charlier <fcharlier@ploup.net>
2022-07-25 18:49:56 +02:00
Johannes 'fish' Ziemke d962e48ca2 Add sysctl collector
Signed-off-by: Johannes Ziemke <github@5pi.de>
2022-07-25 18:27:48 +02:00