Commit graph

528 commits

Author SHA1 Message Date
James Hartig 60c827231a NRestarts or NRefused aren't available on older systemd versions (#1039)
* If NRestarts or NRefused are not available, don't ignore the unit itself
* Don't report systemd metrics (NRestarts/NRefused) that are not available

Signed-off-by: James Hartig <james@getadmiral.com>
2018-08-14 14:28:26 +02:00
Ben Kochie fe5a117831
Handle vanishing PIDs (#1043)
PIDs can vanish (exit) from /proc/ between gathering the list of PIDs
and getting all of their stats.

* Ignore file not found errors.
* Explicitly count the PIDs we find.
* Cleanup some error style issues.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-08-13 17:27:23 +02:00
Ben Kochie 0662673ad6
Disable wifi collector by default (#1037)
* Disable wifi collector by default

Disable the wifi collector by default due to suspected cashing issues and goroutine leaks.
* https://github.com/prometheus/node_exporter/issues/870
* https://github.com/prometheus/node_exporter/issues/1008

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-08-07 10:27:20 +02:00
Ben Kochie 5d23ad0ca7
Fix supervisord collector (#978)
* Replace supervisord xmlrpc library
* Use `github.com/mattn/go-xmlrpc` that doesn't leak goroutines.
* Fix uptime metric

* Use Prometheus best practices for uptime metric.
  * Use "start time" rather than "uptime".
  * Don't emit a start time if the process is down.
* Add changelog entry.
* Add example compatibility rules.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-08-06 16:54:46 +02:00
Julius Volz 2c52b8c761
systemd: Remove unneeded/unhandled error returns (#1035)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2018-08-05 16:55:25 +02:00
Christian Hoffmann 6bdc5558ec build: make staticcheck happy by using real regexp patterns #1025 (#1026)
Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
2018-07-30 07:57:18 +02:00
Hannes Körber 14a4f0028e Enable nfs protocol (#998)
* vendor: Update prometheus/procfs

Signed-off-by: Hannes Körber <hannes.koerber@haktec.de>

* mountstats: Use new NFS protocol field

In https://github.com/prometheus/procfs/pull/100, the NFSTransportStats
struct was expanded by a field called protocol that specifies the NFS
protocol in use, either "tcp" or "udp". This commit adds the protocol as
a label to all NFS metrics exported via the mountstats collector.

Signed-off-by: Hannes Körber <hannes.koerber@haktec.de>

* Update fixtures for UDP mount

Signed-off-by: Hannes Körber <hannes.koerber@haktec.de>
2018-07-24 00:47:12 +02:00
Johannes Wienke 5c780d132c Exclude only subdirectories of /var/lib/docker (#1003)
It is quite common to put /var/lib/docker itself on a separate partition
and that should be monitored as well.

Signed-off-by: Johannes Wienke <languitar@semipol.de>
2018-07-23 15:43:42 +02:00
Ben Kochie 23f95c8e04
Fix ntp collector thread safety (#1014)
Make the ntp collector thread safe by wrapping a mutex lock around the
leapMidnight variable.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-07-22 14:36:33 +02:00
xginn8 140b8b85c3 Filter out uninstalled systemd units when collecting all units (#1011)
fixes #567

Signed-off-by: Matthew McGinn <mamcgi@gmail.com>
2018-07-22 09:20:03 +02:00
Sven Lange 2ae8c1c7a7 Add systemd uptime metric collection (#952)
* Add systemd uptime metric collection

Signed-off-by: Sven Lange <tdl@hadiko.de>
2018-07-18 16:02:05 +02:00
neiledgar 7e4d9bd150 Update wifi stats to support multiple stations (#977) (#980)
Signed-off-by: neiledgar <neil.edgar@btinternet.com>
2018-07-16 16:02:25 +02:00
xginn8 9b97f44a70 Add a counter for refused socket unit connections, available as of systemd 239 (#995)
Signed-off-by: xginn8 <mamcgi@gmail.com>
2018-07-16 16:01:42 +02:00
Brandon Gilmore 76bbd8dd18 Use /proc/mounts instead of statfs(2) for ro state (#1002)
While the statfs(2) approach is reliable for normally mounted filesystems, the
flags returned can be inconsistent when filesystem has been remounted read-only
after encountering an error. The returned flags do accurately represent the
internal state of the filesystem, but they do not reflect whether the VFS layer
will accept writes. Instead, it makes sense to parse the current VFS mount
state from the options field in /proc/mounts since it takes precedence.

Signed-off-by: Brandon Gilmore <bgilmore@valvesoftware.com>
2018-07-16 15:56:27 +02:00
Jan Klat c4102f1175 Add sys/class/net parsing from procfs and expose its metrics (#851)
* add sys/class/net parsing from procfs and expose its metrics

Signed-off-by: Jan Klat <jenik@klatys.cz>

* change code to use int pointers per procfs change, move netclass to separate collector, change metric naming

Signed-off-by: Jan Klat <jenik@klatys.cz>

* bump year in licence, remove redundant newline, correct fixtures

Signed-off-by: Jan Klat <jenik@klatys.cz>

* fix style

Signed-off-by: Jan Klat <jenik@klatys.cz>

* change carrier changes to counter type

Signed-off-by: Jan Klat <jenik@klatys.cz>

* fix e2e output

Signed-off-by: Jan Klat <jenik@klatys.cz>

* add fixtures

Signed-off-by: Jan Klat <jenik@klatys.cz>

* update vendor, use fixtures correctly

Signed-off-by: Jan Klat <jenik@klatys.cz>

* change fixtures (device in /sys/class/net should be symlinked)

Signed-off-by: Jan Klat <jenik@klatys.cz>

* correct fixtures for 64k page, updated readme

Signed-off-by: Jan Klat <jenik@klatys.cz>
2018-07-16 15:08:18 +02:00
mknapphrt 09b4305090 Changed the way that stuck mounts are handled. If a mount fails to return, it will stop being queried until it returns. (#997)
Fixed spelling mistakes.

Update transport_generic.go

Changed to a mutex approach instead of channels and added a timeout before declaring a mount stuck.

Removed unnecessary lock channel and clarified some var names.

Fixed style nits.

Signed-off-by: Mark Knapp <mknapp@hudson-trading.com>
2018-07-14 11:10:28 +02:00
xginn8 ac5a981761 Adding socket stat collection for systemd socket units (#968)
Signed-off-by: xginn8 <mamcgi@gmail.com>
2018-07-05 16:26:48 +02:00
xginn8 8af84a215d Add support for NRestarts counter introduced in systemd 235 (#992)
* Add support for NRestarts counter introduced in systemd 235

`.service` units increment this counter any time the Restart= condition is
triggered.

Signed-off-by: Matthew McGinn <mamcgi@gmail.com>
2018-07-05 13:31:45 +02:00
Ben Kochie 107e5dfecc
Fix mdadm collector issues (#985)
* Send "Personality unknown" to debug, not info, remove unnecessary newline.
* Add support for "linear" personality.
* Always set number of active disks to 0 when a device is inactive.
* Add total disks calculation to unknown personalites.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-07-02 12:38:20 +02: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
Brad Beam e3cf1d5187 Adding support for evaluating octal characters in mountpoint (#954)
Signed-off-by: Brad Beam <brad.beam@b-rad.info>
2018-06-06 16:49:19 +02:00
Pavlo Kutishchev 456bf5094a Add processes exporter (#950)
* Add processes exporter

Signed-off-by: Pavel Kutishchev <pavel.kutishchev@olx.com>
Signed-off-by: Ben Kochie <superq@gmail.com>
2018-06-05 19:38:32 +02:00
Alexey Kopytov dd98a09bb2 A couple of ARM64-related fixes (#934)
* Do not rely on AArch64 CPUs to support 32-bit ARM for cross-testing.

Signed-off-by: Alexey Kopytov <akopytov@gmail.com>

* aarch64 like ppc64le reports 64k node_sockstat_TCP_mem_bytes due to 64k pages.

Signed-off-by: Alexey Kopytov <akopytov@gmail.com>
2018-05-14 15:55:49 +02:00
Steve Kotsopoulos 84dc362b05 Align Darwin disk stat names with Linux (#930)
Signed-off-by: Steve Kotsopoulos <sk@fywss.com>
2018-05-02 11:32:55 +02:00
Mario Trangoni 24a28fcc9e Remove unused func, var, and const (#928)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-04-29 14:35:43 +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 361b5bf85d
Merge pull request #852 from prometheus/remove-gmond
Remove gmond collector
2018-04-27 10:02:16 +02:00
Ben Kochie b10ca77680
Fix /proc/net/dev/ interface name handling
* Allow any character (UTF-8) for Linux interface names.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-04-18 12:53:59 +02:00
Ben Kochie 1ab4a460c7 Update ppc64le end-to-end fixture.
Signed-off-by: Ben Kochie <superq@gmail.com>
2018-04-18 09:12:21 +02:00
Johannes 'fish' Ziemke fd66a86a30 Remove gmond collector
Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2018-04-17 20:20:24 +02:00
Ben Kochie 0f5be132ac
Merge pull request #904 from prometheus/superq/if_alias
Fix parsing of interface aliases in netdev linux
2018-04-17 13:37:21 +02:00
Ben Kochie a528966dcd Fix parsing of interface aliases in netdev linux
Very old kernels expose interface aliases as `foo0:0`, adjust the line
parsing to handle these names.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-04-17 13:15:02 +02:00
Ben Kochie f6008b242b
Merge pull request #901 from mischief/bsd_boottime
collector: implement node_boot_time_seconds for OpenBSD/NetBSD/Darwin
2018-04-17 07:48:39 +02:00
Jürgen Hötzel de0632c2e9 Fix memory corruption when number of filesystems > 16 (#900)
Signed-off-by: Juergen Hoetzel <juergen@archlinux.org>
2018-04-16 12:39:15 +02:00
mischief 26a385d7ab collector: implement node_boot_time_seconds for OpenBSD/NetBSD/Darwin
Signed-off-by: mischief <mischief@offblast.org>
2018-04-15 08:26:46 +00:00
Ben Kochie 015b86670a
Update ppc64le e2e output.
Signed-off-by: Ben Kochie <superq@gmail.com>
2018-04-14 15:28:06 +02:00
Ben Kochie 0507b0c9a2
Fix formatting.
Signed-off-by: Ben Kochie <superq@gmail.com>
2018-04-14 15:02:20 +02:00
Dmitriy Lukyanchikov eddd1b9357 Fix netdev collector for linux (#890)
fix variable name, fix transmitHeader extracting
modify fixtures to run tests with updated netdev_linux collector

Signed-off-by: dmitriy-lukyanchikov <d.lukyanchikov@anchorfree.com>
2018-04-14 13:58:56 +02:00
Derek Marcotte fe86e908da Update ppc64 fixtures to unbreak end-to-end.
efc1fdb added new labels.

Signed-off-by: Derek Marcotte <554b8425@razorfever.net>
2018-04-13 06:33:38 -04:00
Karsten Weiss 7e392e6634 Fix spelling mistakes found by codespell
Signed-off-by: Karsten Weiss <knweiss@gmail.com>
2018-04-09 18:27:17 +02:00
Karsten Weiss efc1fdb6d0 cpu: Add a 2nd label 'package' to metric node_cpu_core_throttles_total (#871)
* cpu: Add a 2nd label 'package' to metric node_cpu_core_throttles_total

This commit fixes the node_cpu_core_throttles_total metrics on
multi-socket systems as the core_ids are the same for each package.
I.e. we need to count them seperately.

Rename the node_package_throttles_total metric label `node` to `package`.

Reorganize the sys.ttar archive and use the same symlinks as the Linux
kernel. Also, the new fixtures now use a dual-socket dual-core cpu w/o
HT/SMT (node0: cpu0+1, node1: cpu2+3) as well as processor-less
(memory-only) NUMA node 'node2' (this is a very rare case).

Signed-off-by: Karsten Weiss <knweiss@gmail.com>

* cpu: Use the direct /sys path to the cpu files.

Use the direct path /sys/devices/system/cpu/cpu[0-9]* (without symlinks)
instead of /sys/bus/cpu/devices/cpu[0-9]*.

The latter path also does not exist e.g. on RHEL 6.9's kernel.

Signed-off-by: Karsten Weiss <knweiss@gmail.com>

* cpu: Reverse core+package throttle processing order

Signed-off-by: Karsten Weiss <knweiss@gmail.com>

* cpu: Add documentation URLs

Signed-off-by: Karsten Weiss <knweiss@gmail.com>
2018-04-09 18:01:52 +02:00
Brian Brazil 31ce32f1fe
Greatly trim what netstat collector exposes by default (#876)
Netstat is 40% of the metrics on my laptop, many of which
are highly detailed information about IP internals in the kernel.
~300 such metrics on every machine in your fleet is excessive,
so focus on key metrics by default, overridable by the user.

Fixes #515

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-03-30 19:28:08 +01:00
Ben Kochie cf3edadcbb Update fixtures
* Add oom_kill to fixture.
* Update e2e outputs.
* Put regexp in order.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-03-29 22:00:02 +01:00
Brian Brazil 499c342fed Greatly reduce the metrics vmstat returns by default.
Vmstat has over 100 fields, most of which are highly
detailed debug information. Trim this down to only
essential fields by default, configurable by flag.

Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-03-29 22:00:02 +01:00
Brian Brazil c8c144587e
Enable bonding collector by default. (#872)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
2018-03-29 15:18:12 +01:00
Ben Kochie 779090db7e
Update ppc64le fixture (#867)
Update to match standard e2e output.

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-03-27 17:05:20 +02:00
Mario Trangoni 1f11a86d59 Fix nfs golint issues (#863)
* procfs: update vendoring

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

* procfs: fix e2e tests after nfs changes

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2018-03-22 22:25:37 +01:00
Ben Kochie 7b720df1c5
Use lowercase cpu label name in interrupts (#849)
To match other CPU related metric labels, use a lowercase named label.
2018-03-08 15:04:49 +01:00
Johannes 'fish' Ziemke 424ca8e322 Drop exec_ in boot_timestamp_seconds on *bsd (#839)
This closes #827.
2018-03-08 12:59:48 +01:00
colmbuckley 098f975b48 Correct the ClocksPerSec scaling factor on Darwin (#846)
* Update cpu_darwin.go

Change the definition of ClocksPerSec to read from limits.h

* Update cpu_darwin.go
2018-03-07 11:56:57 +01:00