Commit graph

343 commits

Author SHA1 Message Date
Johannes 'fish' Ziemke 6dd39b15c2 Do not build meminfo on freebsd 2017-01-04 16:02:49 +01:00
Johannes 'fish' Ziemke a97ff2bcda Do not build meminfo on windows 2017-01-04 15:16:13 +01:00
Johannes 'fish' Ziemke d17b1b44a6 Merge pull request #398 from prometheus/fish-netdev-check-scan-errror
Check for errors in netdev scanner
2017-01-03 16:00:08 +01:00
Johannes 'fish' Ziemke 9969f93e7d Merge pull request #387 from discordianfish/fish-fix-meminfo-darwin
Refactor meminfo and add darwin metrics
2017-01-03 14:50:52 +01:00
Johannes 'fish' Ziemke 6576571ac8 Check for errors in netdev scanner 2017-01-03 14:48:52 +01:00
Johannes 'fish' Ziemke 26c6182c84 Move comment and remove superfluous newline 2017-01-03 14:41:05 +01:00
Johannes 'fish' Ziemke b68a9ec7af Merge pull request #359 from CloudAndHeat/feature/hwmon_chip_name_metric
hwmon: Provide annotation metric to link chip sysfs paths to human-readable chip types
2017-01-03 14:38:43 +01:00
Johannes 'fish' Ziemke 4e696d5d31 Merge pull request #391 from discordianfish/fish-add-cpu-darwin
Add cpu collector for darwin
2017-01-03 14:23:50 +01:00
Johannes 'fish' Ziemke 079fd701a0 Merge pull request #389 from prometheus/fish-use-const-metrics
Convert remaining collectors to use ConstMetrics
2017-01-03 14:22:58 +01:00
Johannes 'fish' Ziemke d2ca252457 Merge pull request #393 from discordianfish/fish-add-netdev-darwin
Add netdev collector for darwin
2017-01-03 14:12:36 +01:00
Johannes 'fish' Ziemke 8e50b80d12 Convert remaining collectors to use ConstMetrics 2017-01-03 14:11:10 +01:00
Johannes 'fish' Ziemke 3db2f442ae Limit node-exporter scope, deprecated collectors 2017-01-03 14:03:23 +01:00
Johannes 'fish' Ziemke c21c59dfeb Add meminfo stats for Darwin 2017-01-03 11:22:46 +01:00
Johannes 'fish' Ziemke 2983c4a31d Refactor meminfo collector similar to filesystem
Instead of doing the whole metric exposition in a platform specific collector
implementation, this creates and updates the metrics in meminfo.go and
expected a platform specific implementation of getMemInfo on
*meminfoCollector.
2017-01-03 11:20:36 +01:00
Johannes 'fish' Ziemke 3c47ef8e60 Add netdev collector for darwin
Same as for openbsd, this is just slightly adjusted from freebsd
variant.
2016-12-29 19:17:15 +01:00
Dominik Honnef f0adcd163d Implement CPU collector on FreeBSD without cgo 2016-12-29 04:29:52 +01:00
Dominik Honnef d2a43f7d05 Implement meminfo on BSD without cgo
This removes some error handling, which should be fine. If the calls
fail, we will get the zeroes, which is a safe enough fallback.
Additionally, if the first sysctl (page_size) succeeded it is unlikely
that other ones will fail.
2016-12-29 02:19:21 +01:00
Johannes 'fish' Ziemke 050d6f7f13 Add cpu collector for darwin 2016-12-28 18:38:52 +01:00
Dominik Honnef 0f6191987e Implement file systems on FreeBSD without cgo
The code may also work for other BSDs, but I don't have access to those
for testing.
2016-12-26 23:06:17 +01:00
Dominik Honnef 54c74923ee Implement loadavg on FreeBSD without cgo
The code may also work for other BSDs, but I don't have access to those
for testing.
2016-12-26 23:06:05 +01:00
Ben Kochie 10e525ff02 Merge pull request #375 from prometheus/fish-add-runit-servicedir-flag
Add runit service dir flag
2016-12-26 13:01:51 +01:00
Johannes 'fish' Ziemke d506b2266c Merge pull request #374 from prometheus/fish-add-filesystem-errors
Add node_filesystem_device_errors_total metric
2016-12-26 11:51:14 +01:00
Bjørn Forsman 64e637cbcc Ignore autofs filesystems on linux
node_exporter currently triggers autofs to mount the underlying
filesystem on every scrape. This is undesirable. Better ignore autofs.

The underlying filesystem that autofs mounts will be monitored though,
when the (real) filesystem is mounted.
2016-12-25 15:13:45 +01:00
Johannes 'fish' Ziemke 71ea37987f Merge pull request #365 from EdSchouten/drbd
A collector for DRBD
2016-12-25 11:04:43 +01:00
Ed Schouten b0d15eaac6 Reduce the severity of these messages.
They get printed all the time, as there are some tokens in the /proc
file that we simply don't support. It's better to keep these as
debugging messages, which may come in useful if new tags start to
appear.
2016-12-23 15:57:46 +01:00
Ed Schouten 4adf7fa96c Improve the help strings, as proposed in the code review. 2016-12-23 15:55:49 +01:00
Ed Schouten b7daf27678 Process feedback from the code review.
- Use the right number of printf() arguments. Use %q where it makes sense.
- Use "DRBD" instead of "Drbd", per Go's style guide.
- Add _total suffixes to counter metrics.
- Mention the unit (bytes) in documentation strings once more.
2016-12-22 13:57:19 +01:00
Björn Rabenstein 08c9347e88 Merge pull request #367 from mdlayher/mountstats
Add mountstats collector for detailed NFS statistics
2016-12-20 17:20:41 +01:00
Matt Layher 25a93e38e7
Add mountstats collector for detailed NFS statistics 2016-12-20 11:13:02 -05:00
Johannes 'fish' Ziemke 9039a425d0 Add runit service dir flag 2016-12-19 13:10:38 +01:00
Johannes 'fish' Ziemke deebf0aa49 Add node_filesystem_device_errors_total metric
This metric is the total number of errors occurred when getting stats
for the given device.
2016-12-19 11:48:32 +01:00
Ed Schouten d1fa279105 Use a descriptive name for the file descriptor. 2016-12-16 11:45:14 +01:00
Ben Kochie 677ed28575 Merge pull request #361 from lucasbergman/mips-build-fix
mips64 build fix
2016-12-16 11:39:53 +01:00
Ed Schouten 6ff620e387 Properly propagate parse errors. 2016-12-16 11:36:36 +01:00
Ed Schouten 6269f7502a Add a collector for DRBD.
This collector exposes most of the useful information that can be found
in /proc/drbd. Sizes are normalised to be in bytes, as /proc/drbd uses
kibibytes.
2016-12-11 11:55:28 +01:00
Ed Schouten a696830c38 Add a collector for NFS client statistics.
This change adds a new collector called "nfs" that parses the contents
of /proc/net/rpc/nfs and turns it into metrics. It can be used to
inspect the number of operations per type, but also to keep an eye on an
extraneous number of retransmissions, which may indicate connectivity
issues.

I've picked the name "nfs", as most operating systems use "nfs" for the
client component and "nfsd" as the server component. If we want to add
stats for the NFS server as well, we'd better call such a collector
"nfsd".
2016-12-09 19:58:08 +01:00
Jonas Wielicki 3efaa1a6a8 Update end-to-end tests 2016-12-01 10:00:50 +01:00
Jonas Wielicki c481dd19da Re-introduce human-readable chip types
The chip label generation has been changed in #334 to prefer the
unique device path (e.g. the location on the PCI bus) due to #333.

Here, a new annotation metric ``node_hwmon_chip_names`` is
introduced which allows to link the unique chip sysfs path to a
human-readable chip name which may not be unique among chip sysfs
paths (for example, dual-slot systems have multiple
chipType="coretemp" sensors).

This allows to mitigate the downsides of the solution to #333
(namely that the device path may not be stable across kernels and
reboots) for cases where it does not matter that multiple devices
may have the same human-readable name (e.g. aggregation or where
at most one device with a common chip name is present).

For cases where no human-readable name can be derived, the
annotation metric is not emitted.
2016-12-01 09:59:52 +01:00
Lucas Bergman 4f479e55e0 linux/mips: Unbreak the build
Specifically, uname syscall support on Linux is controlled by a build
tag white list, and both mips64 platforms were missing from the list.
2016-11-30 13:13:49 -06:00
Ben Kochie f8af350ae2 Merge pull request #346 from mcdan/people/mcdan/issues/219
Fix additional mdadm parsing cases
2016-11-17 21:13:38 +01:00
dan mcweeney 13aa37025f Feedback on PR, thanks @tcolgate for the review 2016-11-17 10:23:01 -05:00
Ben Kochie 4fd03c31e4 Merge pull request #323 from stuartnelson3/dfly-devstat
Dragonfly devstat
2016-11-17 13:33:50 +01:00
Ben Kochie 7a9aad01b4 Merge pull request #310 from stuartnelson3/dfly-cpu
export DragonFlyBSD CPU time
2016-11-17 13:33:11 +01:00
stuart nelson e589a2b8af Remove gauges and convert to NewConstMetric format 2016-11-17 13:23:54 +01:00
stuart nelson 2b74cf7498 Export devstat for dragonfly 2016-11-17 13:23:54 +01:00
dan mcweeney 1f6b5aee39 #219 - add fixes for @samzhang111 super token 2016-11-16 14:49:57 -05:00
dan mcweeney 8d756cab50 Fixes end to end test 2016-11-16 14:47:03 -05:00
dan mcweeney 00c9a88a55 Fixes #219 - use the default to catch personalities that are unknown
Assumes all raid configurations start with raid and that anything
else is unknown.
2016-11-16 14:47:03 -05:00
Ed Schouten 9749c2c0b3 mdstat: Fix parsing of RAID0 lines that contain additional attributes.
We seem to have a small number of Linux servers here that have lines in
/proc/mdstat that cannot be parsed by the node exporter, due to them
containing attributes that are not matched by the regular expression
("super 1.2").

Extend the regular expression to skip this data, just like we do for all
of the other status lines.
2016-11-16 17:21:25 +01:00
Rene Treffer abe8e297a6 Prefer device path based names over exported names (#334)
* Prefer device path based names over exported names

For some sensors (like coretemp) it is possible that multiple
instances exist, thus base the name on the device path and not on
the exported name.

* Update end-to-end test for dual socket machines

Explicitly have 2 coretemp instances with a symlink for the device
such that the hwmon collector must pick that name (or fail)
2016-10-28 20:25:44 +01:00
Ben Kochie c6162312f2 Add Linux NUMA "numastat" metrics (#249)
* Add Linux NUMA "numastat" metrics
  Read the `numastat` metrics from /sys/devices/system/node/node* when reading NUMA meminfo metrics.
* Update end-to-end test output.
* Add `numastat` metrics as counters.
* Add tests for error conditions.
* Refactor meminfo numa metrics struct
* Refactor meminfoKey into a simple struct of metric data.
  This makes it easier to pass slices of metrics around.
* Refactor tests.
* Fixup: Add suggested fixes.
* Fixup:  More fixes
* Add another scanner.Err() return
* Add "_total" to counter metrics.
2016-10-12 13:07:49 +02:00
Rene Treffer 081ecc5db0 Add hwmon /sensors support (#278)
* Add hwmon support (mainly known from lm-sensors)

This commit adds initial support for linux hardware sensors, exported
through sysfs.

Details of the interface can be found at
https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface

* Add end-to-end test with some real life data

* Cleanup comments on hwmon collector

* Drop raw sensor name from hwmon output

* Let the sensor label be "sensor"

* Add hwmon short description to README.
2016-10-06 16:33:24 +01:00
stuart nelson 450fe0f3ba Add test 2016-09-28 09:10:05 +02:00
stuart nelson cf3710191a Compile meminfo for dfly (#315)
* Compile meminfo for dfly

* Update README.me
2016-09-28 08:08:19 +01:00
stuart nelson ef1925db7d Compile netdev on dragonfly (#314)
* Compile netdev on dragonfly

* Only run netdev bsd test on bsd

* Update README.md
2016-09-27 21:44:13 +01:00
stuart nelson ee37a27d91 Export values as uint64_t 2016-09-20 23:27:56 +02:00
stuart nelson e942d7e234 Maintain granularity in cpu data
Export cpu mode times as original uint64_t data,
and update frequency, and do the conversion to
float64 and subsequent division in go.
2016-09-20 09:10:53 +02:00
Ben Kochie afac1f7433 Update mdstat fixture based on linux source.
Update `Contains` matching for `resync=`
2016-09-19 16:11:16 +02:00
stuart nelson 57f88ac4f6 Update comment 2016-09-19 09:48:53 +02:00
stuart nelson 78c84b1a47 Remove old freq finding code
This is the code that was lifted from the freebsd
implementation, but was not correct.
2016-09-19 09:48:34 +02:00
stuart nelson 45ac033d9e Use correct frequency for calculating cpu time
The correct frequency is the systimer frequency,
not the stathz.

From one of the DragonFly developers:

The bump upon each statclock is:
((cur_systimer - prev_systimer) * systimer_freq) >> 32

systimer_freq can be extracted from following
sysctl in userspace:
sysctl kern.cputimer.freq
2016-09-19 09:35:41 +02:00
stuart nelson 8cc06aab04 Remove unneeded ncpu variable 2016-09-18 17:36:39 +02:00
stuart nelson 9f7822ccdc Remember to bzero string
Duplication was caused by malloc returning a
region of memory that already had data in it.
2016-09-18 16:17:49 +02:00
stuart nelson c02dcdeb35 Remove unused comment. 2016-09-18 14:21:54 +02:00
stuart nelson 3e4a154656 Correctly exporting values
Moved to exporting via a string, which is then
split and parsed.

The string is sometimes duplicated, however.
2016-09-18 14:16:26 +02:00
Ben Kochie 64b82596ef Fix mdadm collector for resync=PENDING.
Add fix for mdadm devices in state `resync=PENDING`.
* Update test and fixture.
2016-09-18 08:30:20 +02:00
stuart nelson 4b4385bd44 Remove free
Don't need it since we aren't malloc'ing
2016-09-17 19:14:31 +02:00
stuart nelson cc5142a007 Remove some unnecessary includes 2016-09-17 19:13:05 +02:00
stuart nelson a9d27ea722 Appears to be working? Still need to cleanup after self 2016-09-17 18:50:08 +02:00
stuart nelson 1d75b376ae checkpoint 2016-09-17 14:43:29 +02:00
stuart nelson 1b7a18c271 Creating slice from C-array
Might not be lined up correctly? Weird output data
in the second CPU.
2016-09-17 14:05:36 +02:00
stuart nelson 61f36ac1ab Activate filesystem collector on DragonFly (#302) 2016-09-11 12:08:00 -04:00
stuart nelson 03da1ea516 successfully exporting one of 2 cpus 2016-09-10 21:13:06 +02:00
stuart nelson cda2f493ee wip 2016-09-10 19:22:34 +02:00
Takuya Nakaike 0f2a87ab22 add s390x support 2016-08-24 08:06:04 -04:00
Calle Pettersson e890743f79 Add white/blacklisting of units for systemd collector 2016-08-20 13:08:03 +02:00
Julius Volz 428746c48e Merge pull request #285 from prometheus/meminfo-bsd-constmetrics
Convert BSD meminfo collector to use ConstMetrics
2016-08-14 20:14:13 +02:00
Julius Volz f0796683fe Convert BSD meminfo collector to use ConstMetrics
This suffers from the same concurrency bug as the netstat one:
https://github.com/prometheus/node_exporter/issues/280
2016-08-13 00:40:29 +02:00
Julius Volz c0b46391e2 Merge pull request #283 from prometheus/meminfo-constmetrics
Convert meminfo collector to use ConstMetrics
2016-08-12 19:02:30 +02:00
Brian Brazil 25289c5024 Merge pull request #284 from prometheus/sockstat-constmetrics
Convert sockstat collector to use ConstMetrics
2016-08-12 00:42:23 +01:00
Julius Volz cef3d98256 Convert sockstat collector to use ConstMetrics
This suffers from the same concurrency bug as the netstat one:
https://github.com/prometheus/node_exporter/issues/280
2016-08-12 01:36:42 +02:00
Julius Volz eac396c637 Convert meminfo collector to use ConstMetrics
This suffers from the same concurrency bug as the netstat one:
https://github.com/prometheus/node_exporter/issues/280
2016-08-12 01:30:15 +02:00
Julius Volz f91bca427b Convert filefd collector to use ConstMetrics
This suffers from the same concurrency bug as the netstat one:
https://github.com/prometheus/node_exporter/issues/280
2016-08-12 01:26:25 +02:00
Julius Volz 9128952454 Fix end-to-end tests after netstat conversion 2016-08-12 01:09:20 +02:00
Julius Volz 8c5c880705 Convert netstat collector to use ConstMetrics
Fixes https://github.com/prometheus/node_exporter/issues/280
2016-08-12 00:34:00 +02:00
Thomas Frössman 32e3445d72 Fix mdstat tabs parsing 2016-08-06 14:08:11 +02:00
Daniel c3eba340e3 Update e2e-output.txt 2016-07-09 15:36:52 +02:00
Daniel 87b3df90e6 Update diskstats 2016-07-09 15:23:31 +02:00
Daniel a7a8d088da Ignore partitions on NVME devices by default
The convention of the linux driver is nvme($device)n($namespace)p($partition). On *bsd it seems to be different, using "ns" instead of "n" as the namespace separator.
2016-07-09 13:23:01 +02:00
Brian Brazil f660b32f08 Merge pull request #267 from mgit-at/sockstat-rhe4
sockstat: add support for RHE4
2016-07-07 21:30:23 +01:00
Johannes 'fish' Ziemke 7e5aaa9e33 Use meminfo_freebsd on darwin as well 2016-07-06 12:12:16 +02:00
Johannes 'fish' Ziemke 4b04d04558 Enable *bsd collector on darwin 2016-07-06 10:24:20 +02:00
Michael Gebetsroither 4b820427dd sockstat: add support for RHE4 2016-07-05 23:24:54 +02:00
slene dea279267a Close file handler in textfile 2016-06-30 00:06:51 +08:00
Karsten Weiss 69ba0e916b filefd_linux.go: Fix a typo. 2016-06-20 18:08:26 +02:00
Matthias Rampke 344fe2c4c5 Merge pull request #253 from prometheus/superq/md_raid0
Add support for raid0 devices in mdadm_linux collector.
2016-06-14 12:14:51 +02:00
Ben Kochie 8c809cd29a Add additional test for mdadm_linux collector 2016-06-11 08:54:39 +02:00
Ben Kochie a09bbaacd1 Add support for raid0 devices in mdadm_linux collector. 2016-06-11 08:54:39 +02:00
Julius Volz ffd96078e0 Merge pull request #241 from mrwacky42/ignore-fs-types
Add flag to ignore certain filesystem types (Copy of #217)
2016-06-06 17:31:29 -04:00
Sharif Nassar f0630d5cbb Do not export the filesystem type pattern 2016-06-06 11:10:50 -07:00