Commit graph

670 commits

Author SHA1 Message Date
Ben Kochie baa7ab732f
Update prometheus/procfs
Fixes: https://github.com/prometheus/node_exporter/issues/1721

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-06-14 14:18:13 +02:00
Jeffrey Stoke cb7ab5119a
Fix collectors' build tags
Signed-off-by: Jeffrey Stoke <me@arhat.dev>
2020-06-12 10:26:30 +02:00
David O'Rourke 217bbdd6b9 helper_test: Fix copyright year
Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2020-06-03 11:33:10 +02:00
David O'Rourke 03450a4d7d filesystem_freebsd: Use bytesToString to get label values
Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2020-06-03 11:33:10 +02:00
David O'Rourke d6fbce1529 helper: Add new bytesToString function and tests
Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2020-06-03 11:33:10 +02:00
David O'Rourke 4c06e33c23 filesystem_freebsd: Fix label values
We must know the length of the various filesystem C strings before
turning them from a byte array into a Go string, otherwise our Go
strings could contain null bytes, corrupting the label values.

Signed-off-by: David O'Rourke <david.orourke@gmail.com>
2020-06-03 11:33:10 +02:00
Wei He 0253277121
Add flag to aggr ipvs metrics to avoid high cardinality metrics (#1709)
Fixes #1708

Signed-off-by: Wing924 <weihe924stephen@gmail.com>
2020-06-02 10:52:00 +02:00
Ben Kochie 2aef188bc8
Merge pull request #1679 from alexnoz/ntp-usage-str-fix
Use clearer usage string for `collector.ntp.server-is-local` option
2020-05-25 13:58:01 +02:00
Ben Kochie f3073755a3
Merge pull request #1690 from shapor/patch-1
Move regexp to global in meminfo_linux.go
2020-05-25 13:57:24 +02:00
Ben Kochie 3565316d7e
Linux CPU: Cache CPU metrics
Cache CPU metrics to avoid counters (ie iowait) jumping backwards.

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

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-05-24 16:31:26 +02:00
Ben Kochie b532c81da7
Update filesystem freebsd
Upstream x/sys/unix changed types.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-05-14 21:02:21 +02:00
Sudhar287 6807e5319b
read contents of objset file (#1632)
* added objread functionality

Signed-off-by: Sudharshann D <sudhar287@gmail.com>
2020-05-13 21:06:00 +02:00
Shapor Naghibzadeh a1a3633d89 Move regexp to global in meminfo_linux.go
Compile regexp outside of parsing function in meminfo_linux.go

Signed-off-by: Shapor Naghibzadeh <shapor@google.com>
2020-04-26 01:13:25 -07:00
Alex Nozdriukhin 744e334ef9 Use clearer usage string for collector.ntp.server-is-local option
Signed-off-by: Alex Nozdriukhin <alex-nozzz@mail.ru>
fixes #1662
2020-04-18 00:53:57 +03:00
alpaca fa4edd700e
Fix accidently empty lines in meminfo_linux (#1671)
* Fix accidently empty lines in meminfo_linux

Signed-off-by: qwertysun <qwertysun@tencent.com>
2020-04-17 12:07:35 +02:00
Daniel Hodges b14168cf6a
Add perf tracepoint collection flag (#1664)
* Add tracepoint collector option for perf collector

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2020-04-17 12:02:08 +02:00
Daniel Hodges 44357ed677
Fix initialization in perf collector when using multiple CPUs (#1665)
* Fix initialization in perf collector when using multiple CPUs

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2020-04-17 11:59:07 +02:00
Peter Bueschel da5972b539
Add gauges for allocated memory for queued UDP and TCP packages (#1503)
* Two new states will be added to the tcpstat collector called rx_queued_bytes and tx_queued_bytes.

For UDP datagrams an additional collector 'udp_queues' can be used to expose the total lengths of the tx_queue and rx_queue.
@SuperQ and @discordianfish this changes gives us the option to check for overloaded UDP + TCP processing.
The names of the new TCP states and the UDP metric can be discussed.
The current reasons are just:

I don't want to add another collector for the same exposed file, so I just added the new states to the tcpstat collector.
I chose the name 'udp_queue' instead of 'udpstat' as UDP has no state.


Signed-off-by: Peter Bueschel <peter.bueschel@logmein.com>
2020-03-31 10:46:32 +02:00
Paweł Krupa 1771fc87d9
collector/systemd: use regexp to extract systemd version (#1647)
Signed-off-by: paulfantom <pawel@krupa.net.pl>
2020-03-27 21:35:56 +01:00
Tom Wilkie 6496c24d61
Metrics for IO errors on Mac. (#1636)
* Metrics for IO errors and retries on Mac.

Signed-off-by: Tom Wilkie <tom@grafana.com>
2020-03-21 21:05:38 +01:00
Benjamin Drung 34d50e15d5 Add model_name and stepping to node_cpu_info metric
The `node_cpu_info` metric contains some information like the `model`
(which is an integer), but not the human readable model name. Also the
stepping of the processor might be interesting, since different stepping
of a processor might behave differently.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2020-03-20 17:27:11 +01:00
Ben Kochie e49a13d0cf
Catch missing schedstat file (#1641)
Suppres error log noise if schedstat file doesn't exist.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-03-19 19:50:36 +01:00
Ben Kochie c4183f9935
Minor cleanup in perf collector (#1616)
* Use `strconv.Itoa()` instead of `fmt.Sprintf()` for simple conversion.
* Eliminate copy-paste in collector setup.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-20 12:05:59 +01:00
Daniel Hodges ec62141388
Fix num cpu (#1561)
* add a map of profilers to CPUids

`runtime.NumCPU()` returns the number of CPUs that the process can run
on. This number does not necessarily correlate to CPU ids if the
affinity mask of the process is set.

This change maintains the current behavior as default, but also allows
the user to specify a range of CPUids to use instead.

The CPU id is stored as the value of a map keyed on the profiler
object's address.

Signed-off-by: Joe Damato <jdamato@fastly.com>
Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
Signed-off-by: Daniel Hodges <hodges@uber.com>

Co-authored-by: jdamato-fsly <55214354+jdamato-fsly@users.noreply.github.com>
2020-02-20 11:36:33 +01:00
Paul Gier b40954dce5
new flag to disable all default collectors (#1460)
* new flag to disable all default collectors

Signed-off-by: Paul Gier <pgier@redhat.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
2020-02-20 11:03:33 +01: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
Ben Kochie 1a75bc7b50
Fix up Darwin swap metrics
* Add a changelog entry.
* Remove redundant swap free metric.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-19 15:52:47 +01:00
jonas-lindmark 9828533697
Swap usage on darwin from sysctl vm.swapusage (#1608)
Signed-off-by: jonas <jonas.lindmark@denacode.se>
2020-02-19 15:51:29 +01:00
Silke Hofstra 8faa843fc4
Add Btrfs collector (#1512)
* Add procfs/btrfs to vendor folder
* Add Btrfs collector

Resolves #1100

Signed-off-by: Silke Hofstra <silke@slxh.eu>
2020-02-19 15:48:51 +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
Phil Porada 14eafab016
Adds metrics and tests for UDP receive and send buffer errors (#1534)
* Adds metrics for UDP receive and send buffer errors

Signed-off-by: Phil Porada <philporada@gmail.com>
2020-02-19 14:41:40 +01:00
Julian Kornberger cfcaeee145
Use strconv.Itoa() instead of fmt.Sprintf() (#1566)
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
2020-02-19 14:34:05 +01:00
Tobias Klauser 6ad94ae4bc
Implement loadavg on all BSDs without cgo (#1584)
Reuse the Go-only implementation already in place for FreeBSD (#385) on
Darwin, DragonflyBSD, NetBSD and OpenBSD.

Tested on all affected platforms.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-18 14:14:35 +01:00
Ben Kochie 1567cefdae
Bump all vendoring (#1612)
Update all vendoring to current releases.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-18 13:27:11 +01:00
Ben Kochie 14df2a1a1a
Update to latest procfs library (#1611)
Bump to v0.0.10 procfs library.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-02-18 11:33:46 +01:00
Johannes 'fish' Ziemke dcfd610433
systemd: Clarify private flag description (#1587)
This requires root, so it shouldn't be used.

This closes #1246

Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
2020-02-15 11:39:45 +01:00
Julien Pivotto 84c6446094 netdev: clean zero-value assignments
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-02-13 12:20:27 +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
Ukri Niemimuukko eac3e30f7f rapl_linux collector
This exposes RAPL statistics from /sys/class/powercap.

Co-Authored-By: Ben Kochie <superq@gmail.com>
Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2020-02-01 12:06:30 +01:00
Paul Cameron 9bb37873a8 Add unix socket support for supervisord collector (#1592)
* Add unix socket support for supervisord collector

For example:
  --collector.supervisord.url=unix:///var/run/supervisor.sock

Fixes prometheus/node_exporter#262

Signed-off-by: Paul Cameron <cameronpm@gmail.com>
2020-01-28 08:50:23 +01:00
Peter Tribble e7a27366a0 Fix Solaris build (typos in function names) (#1522)
Signed-off-by: Peter Tribble <peter.tribble@gmail.com>

Co-authored-by: Ben Kochie <superq@gmail.com>
2020-01-24 18:06:10 +01:00
Thomas Lin 3ddc82c2d8 Fixed inaccurate 'node_network_speed_bytes' when speeds are low (#1580)
Integer division and the order of operations when converting Mbps to Bps
results in a loss of accuracy if the interface speeds are set low.
e.g. 100 Mbps is reported as 12000000 Bps, should be 12500000
     10 Mbps is reported as 1000000 Bps, should be 1250000

Signed-off-by: Thomas Lin <t.lin@mail.utoronto.ca>
2020-01-01 13:10:53 +01:00
Ben Kochie f316099f87
Fix up softnet collector for go-kit change (#1581)
Add missing update for new go-kit logging change.

Signed-off-by: Ben Kochie <superq@gmail.com>
2019-12-31 19:36:39 +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
Peter Nicholson a80b7d0bc5 Add softnet collector (#1576)
Signed-off-by: Peter Nicholson <petergoods@hotmail.com>
2019-12-30 01:36:10 +01:00
Julian Kornberger cafb12dc59 Add cause to error message
Signed-off-by: Julian Kornberger <jk+github@digineo.de>
2019-12-19 15:26:55 +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
Matthieu Guegan 2cae917bb7 fix OpenBSD cache memory information (#1542)
This will now use `bcstats.numbufpages` instead of `uvmexp.vnodepages`.

Inspired by OpenBSD's `src/usr.bin/top`

Signed-off-by: Matthieu Guegan <matthieu.guegan@deindeal.ch>
2019-12-02 13:41:58 +01:00
Matt Layher da6b66371f collector: reimplement sockstat collector with procfs (#1552)
* collector: reimplement sockstat collector with procfs
* collector: handle sockstat IPv4 disabled, debug logging

Signed-off-by: Matt Layher <mdlayher@gmail.com>
2019-11-25 13:41:38 -06:00
Holger Hoffstätte 3c2c4e7b3c Add new counters for flush requests in Linux 5.5 (#1548)
* Add diskstat flush request counters for Linux 5.5+
* Update tests for diskstat flush request counters with Linux 5.5+

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
2019-11-25 13:16:15 -06:00