Commit graph

1722 commits

Author SHA1 Message Date
PrometheusBot 863e737538
Update common Prometheus files (#2177)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2021-10-23 10:29:48 +02:00
Matt Layher 8b198ce168
collector: replace fmt.Sprintf with strconv.Itoa in perfCollector (#2174)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-10-22 21:03:10 +02:00
ngc104 4bc1c02000
fix bug in #2130 (#2170)
Signed-off-by: Yves Mettier <yves.mettier@orange.com>

Co-authored-by: Yves Mettier <yves.mettier@orange.com>
2021-10-21 12:07:38 +02:00
Tom Wilkie a59b2d8990
Merge pull request #2172 from prometheus/datasource-label
Datasource template variable should be labelled 'Data Source'
2021-10-20 18:17:31 +01:00
W. Andrew Denton d514d67d7f ethtool: convert updateSpeeds to a loop.
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
2021-10-20 19:11:30 +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 0f6c84214c ethtool: minor changes to resolve review nits.
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
Tom Wilkie 9bc184d236
Datasource template variable should be labelled 'Data Source'
Signed-off-by: Tom Wilkie <tom@grafana.com>
2021-10-20 17:10:14 +01:00
wenlxie 11bb2f8a95 support thread state
Signed-off-by: wenlxie <wenlxie@ebay.com>
2021-10-19 11:58:43 +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
Ben Kochie 5a38949451
Fix up mixin tests (#2167)
Use new Go install format, cleanup working dir setup.

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-10-14 11:06:01 +02:00
Ben Kochie f67faf9d18
Fixup drm_linux.go build tag.
Signed-off-by: Ben Kochie <superq@gmail.com>
2021-10-11 15:36:44 +02:00
Siavash Safi 5f110dfeb8
Add initial support for monitoring GPUs on Linux (#1998)
Expose GPU metrics using `sysfs/drm`.
`amdgpu` is the only driver which exposes this information through DRM.

Signed-off-by: Siavash Safi <siavash.safi@gmail.com>
2021-10-11 15:26:21 +02:00
Ben Kochie f61be48d94
Use include/exclude flags for ethtool filtering (#2165)
Use the same flag pattern as netdev to make filtering methods the same.
* Move SanitizeMetricName to helper.go

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-10-11 15:12:25 +02:00
Julien Pivotto 68a6c78c0d
Update go to 1.17 (#2159)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-10-03 13:35:24 +02:00
PrometheusBot 68f1e952c8
Update common Prometheus files (#2158)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2021-09-30 08:38:51 +02:00
Michal 186e2e79c8
add yamllint config, fix yamllint errors (#2088)
After a recent change in prometheus/prometheus, Makefile.common includes
now a yamllint target which currently fails. This PR adds the missing
yamllint config and fixes the yamllint errors.

Signed-off-by: Michal Wasilewski <mwasilewski@gmx.com>
2021-09-29 20:12:14 +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
Ben Kochie aeef1edd62
mixin: Add fallback for MemAvailable (#2130)
Add a fallback to Buffers+Cached+MemFree+Slab for older Linux kernels
where the MemAvailable metric is not available for memory utilization.

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-09-28 10:22:06 +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
Ben Kochie 60e9670f14
Bump promtool version in Makefile (#2151)
Fixes: https://github.com/prometheus/node_exporter/issues/2148

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-09-22 20:40:04 +02:00
Johannes 'fish' Ziemke c10aa42a4f
Disable soon to deprecated linters (#2129)
These lead to false positives when build tags disable certain files as
reported in https://github.com/prometheus/node_exporter/issues/1545

They'll get deprecated and removed eventually anyway:
https://github.com/golangci/golangci-lint/issues/1841

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-09-14 17:36:28 +02:00
Johannes 'fish' Ziemke d6d4c6e1ca
Makefile: Use only tar flags that work on bsd tar (#2128)
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-09-14 16:46:44 +02:00
PrometheusBot dc68e035a5
Update common Prometheus files (#2137)
Signed-off-by: prombot <prometheus-team@googlegroups.com>
2021-09-12 16:28:38 +02:00
Sergei Semenchuk a0c20d48db
add node_network_address_info collector (#2105)
* add node_network_address_info collector

emit (interface, addr, netmask, scope) labels for every network
interface

Signed-off-by: binjip978 <binjip978@gmail.com>
2021-09-08 14:50:25 +02:00
Johannes 'fish' Ziemke 6f1286b314 mixin: Drop mode label for num cpu metric
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-09-03 12:13:35 +02:00
Johannes 'fish' Ziemke fa9926c4eb mixin: Cheaper calculation for instance:node_num_cpu:sum
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-09-03 11:34:25 +02:00
Vladislav Rassokhin 4b9d7b63e6 Update CHANGELOG.md
Signed-off-by: Vladislav Rassokhin <vladislav.rassokhin@jetbrains.com>
2021-09-02 15:19:16 +02:00
Vladislav Rassokhin 647e84644c Update github.com/lufia/iostat to v1.1.1
New version contains fix for `panic`, see lufia/iostat#2

Signed-off-by: Vladislav Rassokhin <vladislav.rassokhin@jetbrains.com>
2021-09-02 15:19:16 +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
Ben Kochie aea88e4dc5
Merge pull request #2126 from ventifus/update-safchain-ethtool
mod: update safchain/ethtool dependency.
2021-08-18 09:58:45 +02:00
W. Andrew Denton b1bb05ce25 mod: removed unused safchain/ethtool version
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
2021-08-17 23:59:07 -07:00
W. Andrew Denton 31caa37b16 mod: update safchain/ethtool dependency. Closes #2125
Signed-off-by: W. Andrew Denton <git@flying-snail.net>
2021-08-17 23:49:49 -07:00
Ben Kochie 99567737c1
Merge pull request #2123 from prometheus/superq/cpuGuest
Add flag to disable guest CPU metrics
2021-08-17 14:06:43 +02:00
Ben Kochie 84b36c4fd8
Add flag to disable guest CPU metrics
In high scale virtualized / cloud environments there are typically
no guest VMs. Add a boolean flag to allow disabling the Linux guest
CPU metrics.

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-08-17 13:04:46 +02:00
paulfantom 832909dd25 docs/node-mixin/alerts: make NodeFilesystemAlmostOutOfSpace fire earlier
Signed-off-by: paulfantom <pawel@krupa.net.pl>
2021-08-16 16:35:58 +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
Benjamin Drung 6ac6ea2d13 ethtool: Sanitize metric names
OpenMetrics and the Prometheus exposition format require the metric name
to consist only of alphanumericals and "_", ":" and they must not start
with digits. The metric names from the ethtool stats might contain
spaces, brackets, and dots. Converting them directly to metric names
will produce invalid metric names.

Therefore sanitize the metric names and convert them to lower case.

Fixes: https://github.com/prometheus/node_exporter/issues/2083
Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-08-16 15:28:27 +02:00
Ben Kochie d83d9bdfca
Merge pull request #2117 from prometheus/ethtool-metrics-include-flag
Add collector.ethtool.metrics-include
2021-08-16 12:01:18 +02:00
Johannes 'fish' Ziemke e6b5aaaff4 Add collector.ethtool.metrics-include
This adds a new flag --collector.ethtool.metrics-include to the ethtool
collector. Only metrics matching this regexp will be collected.

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-08-10 18:57:36 +02:00
Benjamin Drung 4356c09ebd ethtool: Use prometheus.BuildFQName
Use `prometheus.BuildFQName` everywhere in `ethtool` instead of
hard-coding the metric names.

Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-08-10 18:20:01 +02:00
Benjamin Drung 3afd382e75 Add --collector.ethtool.ignored-devices
Other network related collectors allow to filter out unwanted devices.
Add this support to the new ethtool collector as well.

Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
2021-08-10 18:09:26 +02:00
Ben Kochie 4d0c1650b5
Merge pull request #2113 from prometheus/superq/release-1.2.2
Release 1.2.2
2021-08-06 15:41:47 +02:00
Ben Kochie 120b9b463e
Release 1.2.2
* [BUGFIX] Fix processes collector long int parsing #2112

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-08-06 14:41:30 +02:00
Ben Kochie 584972d01f
Merge pull request #2112 from prometheus/superq/debug_processes_errors
Fix processes collector long int parsing
2021-08-06 11:15:17 +02:00
Ben Kochie 5d2a4cf7fb
Fix processes collector long int parsing
Update procfs library to include ignored fields ParseInt handling.

Wrap error returns so that the user can know more about what failed.
Returns from getAllocatedThreads() are errors anyway.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-08-06 05:55:24 +02:00
Johannes 'fish' Ziemke 7fc5c6045a Read config from $
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2021-07-27 16:32:05 +02:00