Commit graph

29 commits

Author SHA1 Message Date
Ben Kochie 090957658e
Update logging (#3097)
Some checks failed
golangci-lint / lint (push) Has been cancelled
Switch from promlog/go-kit to promslog/slog for logging.
* Update Go build to 1.23.

Signed-off-by: Ben Kochie <superq@gmail.com>
2024-09-11 10:51:28 +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
Ben Kochie 3bc9a93c20
Add ErrorLog plumbing to promhttp
Fix the error logging of the promhttp handler by connecting it to the
promlog setup.
* Switch to go-kit/log.
* Cleanup CHANGELOG.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2021-06-03 10:47:41 +02: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
Derek Marcotte 2678d68dcc Fix for #945, cpu temperature is signed. (#965)
* Fix for #945, cpu temperature is signed.

Added a type conversion to cpu temperature sysctl.  Will still
collect/report -1 when the value is -1, this is because it should be up
to interpretation whether this is the correct value for the system or
not.

Some drivers will report -1 for cpu temperature.  Other sensors will
report "an input into the fan control algorithm", i.e. not the actual
temperature, but how much fan it wants.  Some people cool their machines
with liquid nitrogen.

Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
2018-06-07 15:01:25 +02:00
Mario Trangoni c9f421d0dd Fix some golint issues (#927)
* collector/cpu_*: rename nodeCpuSecondsDesc to nodeCPUSecondsDesc

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* collector/qdisc_linux.go: add NewQdiscStatCollector comment

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* collector/cpu_linux.go: rename core_map to coreMap

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-04-29 14:34:47 +02:00
Ben Kochie 14d60958d6
Unify CPU collector conventions (#806)
* Unify CPU collector conventions

Add a common CPU metric description.
* All collectors use the same `nodeCpuSecondsDesc`.
* All collectors drop the `cpu` prefix for `cpu` label values.

* Fix subsystem string in cpu_freebsd.

* Fix Linux CPU freq label names.
2018-02-01 18:42:20 +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
Karsten Weiss bca09abf1c golint: Fix NewStatCollector() doc string. 2017-05-14 13:51:47 +02: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
Dominik Honnef d827db8e17 Better error handling when collecting CPU temps
Log why we couldn't collect the temperature, and set metric to NaN if
the CPU should support temperature collection but had an error.
2017-01-05 15:19:56 +01:00
Dominik Honnef 782eaee100 Collect CPU temperatures on FreeBSD 2017-01-05 06:17:16 +01:00
Dominik Honnef 732dd67729 Fix build of cpu_freebsd.go
Corrects an incorrect merge in 8e50b80
2017-01-05 03:16:51 +01:00
Johannes 'fish' Ziemke 8e50b80d12 Convert remaining collectors to use ConstMetrics 2017-01-03 14:11:10 +01:00
Dominik Honnef f0adcd163d Implement CPU collector on FreeBSD without cgo 2016-12-29 04:29:52 +01:00
Kai Storbeck dcfbf40dbf change caps of the constant 2016-04-20 00:22:47 +02:00
Kai Storbeck 365e688cec gofmt, a typo, and an unintended change crept in 2016-04-20 00:19:16 +02:00
Kai Storbeck aac89c524e This should fix it. 2016-04-20 00:08:26 +02:00
Christian Schwarz 1fc84e2fb6 Re-implement CPU metrics collection through sysctls.
This removes the requirement to run `node_exporter` as root or with read
access to `/dev/kmem` in order to get CPU usage statistics.

Once FreeBSD adds a macro for the `kern.cp_times` sysctl, the
`setupSysctlMIBs()` function should be replaced by usage of the macro.
2016-02-17 15:39:21 +01:00
Brian Brazil 2f0d697f8c Do a make format run. 2015-12-18 14:08:52 +00:00
Kirk Russell 89875cefe8 converted freebsd cpu metrics to seconds 2015-09-26 20:58:47 -04:00
Matthias Rampke 2d0d72b97d Add license headers to all code files. 2015-09-26 17:44:39 +02:00
Siavash Safi dddb273dfc Fix some error messages. 2015-07-14 13:58:54 +04:30
Siavash Safi f8ede82488 cpu: Fix build constraints. 2015-07-14 13:58:53 +04:30
Siavash Safi 462b708742 cpu: Code cleanup. 2015-07-14 13:58:50 +04:30
Siavash Safi f7563fe7a2 Remove config from collectors. 2015-07-14 13:58:48 +04:30
Siavash Safi a10ab2c102 Check caller's euid and egid when accessing /dev/mem on FreeBSD. 2015-07-14 13:58:47 +04:30
Siavash Safi 13d5f969a5 Removed freebsd build constraints from source code. 2015-07-14 13:58:46 +04:30
Siavash Safi 23bb9c44b9 Add cpu collector for FreeBSD. 2015-07-14 13:58:43 +04:30