Commit graph

277 commits

Author SHA1 Message Date
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
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
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
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 2d77d8c562
Update e2e output for new common version.
Signed-off-by: Ben Kochie <superq@gmail.com>
2023-01-20 10:38:19 +01: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
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
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
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
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 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
DavidVentura 6477a197da adjust expected output for 64k file
Signed-off-by: DavidVentura <davidventura27@gmail.com>
2022-07-26 12:25:23 +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
Johannes 'fish' Ziemke d962e48ca2 Add sysctl collector
Signed-off-by: Johannes Ziemke <github@5pi.de>
2022-07-25 18:27:48 +02:00
Benoît Knecht 296aa35dd2 end-to-end-test.sh: Use udev fixture and update output
Set the `--path.udev.data` flag to point to the udev fixture, and update the
output fixture with

```console
$ ./end-to-end-test.sh -u
```

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-06 12:30:50 +02:00
Benoît Knecht 9b5d55e511 collector/diskstats: Add fixtures for udev data
Now that we read some data from `/run/udev/data`, add the corresponding
fixtures and update the expected test results accordingly.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2022-07-06 12:30:50 +02:00
Nobuhiro MIKI 3ed95908d6 collector: add slab info
Co-authored-by: Ben Kochie <superq@gmail.com>
Signed-off-by: Nobuhiro MIKI <nmiki@yahoo-corp.jp>
2022-07-06 12:18:27 +02:00
Jonathan Davies 88f1811eb1
Add selinux collector (#2205)
Add selinux collector

Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2022-06-28 05:54:05 +02:00
dependabot[bot] b99f933713
Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2 (#2411)
* Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.12.2.
- [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.12.1...v1.12.2)

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

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

* Update fixtures for client_golang 1.12.2.

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2022-06-26 11:33:15 +02:00
Ben Kochie 59c146e57d
Update end-to-end test for aarch64 (#2415)
Fix up handling of CPU info collector on non-x86_64 systems due to
fixtures containing `/proc/cpuinfo` from x86_64.
* Update e2e 64k page test fixture from an arm64 system.
* Enable ARM testing in CircleCI.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-06-26 09:41:21 +02:00
Ben Kochie a516d4de4a
Cleanup cgroups collector (#2414)
* Correctly name collector file.
* Fix cgroup summary type as gauge.
* Use a boolean metric rather than a label for enabled.

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-06-24 17:15:31 +02:00
Kobe Biello 45c75f1dbc
Add cgroup summary collector (#2408)
* add cgroups summary collector

Signed-off-by: biello <bellusa@qq.com>
Co-authored-by: bielu <bielu@zuoyebang.com>
2022-06-24 12:05:13 +02:00
Fionera 9ece38fca9 refactor: Use netlink for tcpstat collector
Signed-off-by: Tim Windelschmidt <t.windelschmidt@babiel.com>
2022-04-25 10:13:06 +02:00
Ben Kochie 9155971e07
Update Go modues
Update to latest releases.
* Fix up perf collector syntax.

Signed-off-by: Ben Kochie <superq@gmail.com>
2022-03-30 11:47:09 +02:00
Ben Kochie eecc2b1dea
Add device filter flags to arp collector
Allow filtering APR entries based on device. Useful for ignoring
entries for network namespaces (containers).

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-12-16 15:41:10 +01:00
heyitao 7dbf358915 delete duplicate items
Signed-off-by: heyitao <linuxgcc@163.com>
2021-12-09 11:50:10 +01:00
Ben Kochie 1d5afd05b5
Sanitize UTF-8 in dmi collector (#2229)
Replace invalid UTF-8 chars with "�" string.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-12-01 11:13:43 +01:00
Jacob Vosmaer 5c8d162ca6
Add node_softirqs_total metric (#2221)
This adds a new Linux metric, node_softirqs_total, which corresponds
to the 'softirq' line in /proc/stat. This metric is disabled by
default and it can be enabled with '--collector.stat.softirq'.

Signed-off-by: Jacob Vosmaer <jacob@gitlab.com>
2021-12-01 09:55:13 +01:00
Martin Kennelly 4065902fe5
Add TCPTimeouts to netstat default filter (#2189)
TCP timeouts count is a useful signal to show
abnormal network performance and is another
signal to aid debugging. This metric can be
used to generate proactive alerts for host
network namespace workloads.

Signed-off-by: Martin Kennelly <mkennell@redhat.com>
2021-11-18 09:34:55 +01:00
Benjamin Drung d85cbaa17c
ethtool: Prevent duplicate metric names (#2187)
Sanitizing the metric names can lead to duplicate metric names:

```
caller=level.go:63 level=error caller="error gathering metrics: [from Gatherer #2] collected metric \"node_ethtool_giant_hdr\" { label:<name:\"device\" value:\"ens192\" > untyped:<value:0" msg=" > } was collected before with the same name and label values"
```

Generate a map from the sanitized metric names to the metric names from
ethtool. In case of duplicate sanitized metric names drop both metrics,
because it is unknown which one to take.

Fixes: https://github.com/prometheus/node_exporter/issues/2185
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-11-15 11:22:36 +01:00
Johannes 'fish' Ziemke 85e20238e7
Add clocksource metrics to time collector (#2197)
* Add clocksource metrics to time collector

This closes #1336

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-11-12 11:45:31 +01:00
Benjamin Drung 9def2f9222
Add DMI collector (#2131)
Add a DMI collector to expose the Desktop Management Interface (DMI)
info from `/sys/class/dmi/id/`. This will expose information about the
BIOS, mainboard, chassis, and product.

Closes: https://github.com/prometheus/node_exporter/issues/303
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-10-27 13:56:37 +02:00
W. Andrew Denton 56e6dcb1fa ethtool: add newline to settings fixture.
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
2021-10-20 19:11:30 +02:00
W. Andrew Denton 77a3c9bc20 Gather additional link info from ethtool.
The ethtool_cmd	struct from the	linux kernel contains information about the speeds and features	supported by a
network device. This includes speeds and duplex	but also features like autonegotiate and 802.3x pause frames.

Closes #1444

Signed-off-by: W. Andrew Denton <git@flying-snail.net>
2021-10-20 19:11:30 +02:00
Kiril Vladimirov 1721de0c38
collector: Unwrap glob textfile directories (#1985)
* collector: Unwrap glob textfile directories
* collector: Store full path in mtime's file label

The point is to avoid duplicated gauges from files with the same name in
different directories.

This introduces support for exporting from multiple directories matching
given pattern (e.g. `/home/*/metrics/`).

Signed-off-by: Kiril Vladimirov <kiril@vladimiroff.org>
2021-10-18 14:05:21 +02:00
Aleksei Zakharov 0e6b23c338
Lnstat: expose metrics from /proc/net/stat (#1771)
* Lnstat initial commit

Signed-off-by: Aleksei Zakharov <zaharov@selectel.ru>
Co-authored-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-09-28 10:24:18 +02:00
ventifus 0aec407666
Refactor diskstats (#2141)
* Refactor diskstats_linux to use procfs.
* Add `node_disk_info` metric.

Signed-off-by: W. Andrew Denton <git@flying-snail.net>
Co-authored-by: W. Andrew Denton <git@flying-snail.net>
2021-09-28 10:14:12 +02:00
Sergei Semenchuk 5de46c6bac
collect flag_info and bug_info only for one core (#2156)
Signed-off-by: binjip978 <binjip978@gmail.com>
2021-09-28 07:44:03 +02:00
Sergei Semenchuk 2b490d645e
add path label to rapl collector (#2146)
Signed-off-by: binjip978 <binjip978@gmail.com>
2021-09-27 22:57:03 +02:00
Benjamin Drung b6215e649c Add os release collector
Currently Node Exporter has a metric called `node_uname_info` which of
course exposes uname info. While this is nice, it does not help if you
are running different OSes which could have similar uname info.

Therefore parse `/etc/os-release` or `/usr/lib/os-release` and expose a
`node_os_info` metric which provide information regarding the OS
release/version of the node. Also expose the major.minor part of the OS
release version as `node_os_version`.

Since the os-release files will not change often, cache the parsed
content and only refresh the cache if the modification time changes.

This `os` collector will read files outside of `/proc` and `/sys`, but
the os-release file is widely used and the format is standardized:
https://www.freedesktop.org/software/systemd/man/os-release.html

Bug: https://github.com/prometheus/node_exporter/issues/1574
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-08-19 14:04:21 +02:00
Benjamin Drung 26ca609183 ethtool: Expose node_ethtool_info metric
Add a `node_ethtool_info` metric to all ethtool devices to expose driver
information with following labels:

 * bus_info
 * driver
 * expansion_rom_version
 * firmware_version
 * version

This metric is useful to monitor the firmware version to be up-to-date.

Note: The version label might be malformed due to bug #39 in ethtool:
https://github.com/safchain/ethtool/issues/39

Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-08-16 16:09:35 +02:00
Ben Kochie 97d4b01691
Bump prometheus/procfs library
Pull in bug fix for noisy logging.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-07-21 21:40:21 +02:00
Ben Kochie a6ebe10455
Merge branch 'master' into nvme 2021-07-12 17:09:51 +02:00