Commit graph

19 commits

Author SHA1 Message Date
Trey Dockendorf 0692791457 Add more IB counters
Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu>
2020-11-12 09:35:13 -05:00
Ben Kochie dfa53f835a
Use Go 1.13 error features
* Use `errors.Is()` for unwrapping errors.
* Use `%w` error verb in internal error formatting.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-06-16 14:47:03 +02:00
Ben Kochie 3e1b0f1bee
Don't count empty collection as success (#1613)
Many collectors depend on underlying features to be enabled. This causes
confusion about what "success" means. This changes the behavior of the
`node_scrape_collector_success` metric.

* When a collector is unable to find data don't return success.
* Catch the no data error and send to Debug log level to avoid log spam.
* Update collectors to support this new functionality.
* Fix copy-pasta mistake in infiband debug message.

Closes: https://github.com/prometheus/node_exporter/issues/1323

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-19 16:11:29 +01:00
Benjamin Drung ca1ac435ea
Collect non-numeric data from /sys/class/infiniband (#1563)
Let the node exporter collect the non-numeric data from
/sys/class/infiniband: board ID, firmware version, and HCA type.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
2020-02-19 15:18:44 +01:00
Ben Kochie 92ea3c6a3f Fix inifiband collector log noise (#1599)
Handle non-existent infiniband results silent.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-08 17:18:17 +01:00
Ben Ye 2477c5c67d switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-12-31 17:19:37 +01:00
Julian Kornberger 043fecbfd8 Wrap errors in the Go 1.13 way
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
2019-12-19 15:26:55 +01:00
Benjamin Drung 04fbcfffa1 Collect InfiniBand port state and physical state (#1357)
Collect the InfiniBand port state, the physical state, and the maximum
signal transfer rate.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2019-11-22 13:52:17 -08:00
Benjamin Drung 27b8c93a5a Use InfiniBandClass from procfs library (#1396)
Parsing the sysfs files for InfiniBand was added to the procfs library
(see https://github.com/prometheus/procfs/pull/164).

Therefore use `InfiniBandClass` from the procfs library instead of
parsing sysfs itself.

If the port counter return `N/A (no PMA)` no metric will be returned
(instead of returning 0 for this metric.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2019-09-23 18:18:35 +02:00
Patrick bdc0e7e678 Collect additional common Infiniband counters (#1120)
* Collect additional common Infiniband counters

Signed-off-by: Patrick Freeman <will.pat.free@gmail.com>
2018-10-30 21:54:09 +01:00
Mario Trangoni 3659260b66 infiniband: Handle iWARP* RDMA modules N/A (#974)
* infiniband: Add not connected i40iw0/ports/1 fixtures
* infiniband: Handle issue when iWARP* RDMA modules are not available

This is related to #966, and handle this error,

Jun 07 13:33:24 hostname node_exporter[81888]: time="2018-06-07T13:33:24+02:00" level=error msg="ERROR: infiniband
collector failed after 0.000929s: strconv.ParseUint: parsing \"N/A (no PMA)\": invalid syntax" source="collector.go:132"

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-10-04 15:05:59 +02:00
Brian Brazil a98067a294 Make metrics better follow guidelines (#787)
* Improve stat linux metric names.

cpu is no longer used.

* node_cpu -> node_cpu_seconds_total for Linux

* Improve filesystem metric names with units

* Improve units and names of linux disk stats

Remove sector metrics, the bytes metrics cover those already.

* Infiniband counters should end in _total

* Improve timex metric names, convert to more normal units.

See
3c073991eb/kernel/time/ntp.c (L909)
for what stabil means, looks like a moving average of some form.

* Update test fixture

* For meminfo metrics that had "kB" units, add _bytes

* Interrupts counter should have _total
2018-01-17 17:55:55 +01:00
Calle Pettersson 859a825bb8 Replace --collectors.enabled with per-collector flags (#640)
* Move NodeCollector into package collector

* Refactor collector enabling

* Update README with new collector enabled flags

* Fix out-of-date inline flag reference syntax

* Use new flags in end-to-end tests

* Add flag to disable all default collectors

* Track if a flag has been set explicitly

* Add --collectors.disable-defaults to README

* Revert disable-defaults flag

* Shorten flags

* Fixup timex collector registration

* Fix end-to-end tests

* Change procfs and sysfs path flags

* Fix review comments
2017-09-28 15:06:26 +02:00
Robert Clark 58f50b31f2 Multiply port data XMIT/RCV metrics by 4 (#579)
According to Mellanox, it is standard practice that the port_xmit_data and port_rcv_data
files are split into 4 lanes. To get the actual transmit and receive values for each
port, the metric needs to be multiplied by 4.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-05-12 07:28:53 +02:00
Robert Clark 3a5917dfdc Add support for legacy InfiniBand drivers
Older versions of the OFED drivers contain 64-bit variants of the port counters and are located in a directory named 'counters_ext'. This patch includes these older metrics that have since been deprecated with OFED 4.0.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-03-20 10:37:21 -05:00
Robert Clark 413e5af502 Skip metric files that don't exist
In case a metric file within the InfiniBand collector doesn't exist, skip the metric in order to allow collection of the remaining valid InfiniBand metrics.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-03-09 11:05:36 -06:00
Tobias Schmidt 922e74d58f Remove unnecessarily named return variables
Named return variables should only be used to describe the returned type
further, e.g. `err error` doesn't add any new information and is just
stutter.
2017-02-28 16:04:25 -04:00
Tobias Schmidt c703435790 Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
Robert Clark 4866adcb71 Add new collector for InfiniBand statistics
Add new metrics for the InfiniBand network protocol including the amount of packets sent and received, the number of times the link has been downed and how many times the link has recovered from an error state.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-02-07 11:09:08 -06:00