aboutsummaryrefslogtreecommitdiff
path: root/node_exporter.go
diff options
context:
space:
mode:
authorideaship <ideaship@users.noreply.github.com>2017-07-07 07:20:18 +0200
committerBen Kochie <superq@gmail.com>2017-07-07 07:20:18 +0200
commit8d902762839282f0c2bf3b77fe33cf5fbfa1d8df (patch)
treec36f6fab0729738d83f7b357b1547ad1777815c7 /node_exporter.go
parentbba075710d52296961b9f2ab8f72c9b19cbd2117 (diff)
downloadprometheus_node_collector-8d902762839282f0c2bf3b77fe33cf5fbfa1d8df.tar.bz2
prometheus_node_collector-8d902762839282f0c2bf3b77fe33cf5fbfa1d8df.tar.xz
prometheus_node_collector-8d902762839282f0c2bf3b77fe33cf5fbfa1d8df.zip
Add bcache collector (#597)
* Add bcache collector for Linux This collector gathers metrics related to the Linux block cache (bcache) from sysfs. * Removed commented out code * Use project comment style * Add _sectors to metric name to indicate unit * Really use project comment style * Rename bcache.go to bcache_linux.go * Keep collector namespace clean Rename: - metric -> bcacheMetric - periodStatsToMetrics -> bcachePeriodStatsToMetric * Shorten slice initialization * Change label names to backing_device, cache_device * Remove five minute metrics (keep only total) * Include units in additional metric names * Enable bcache collector by default * Provide metrics in seconds, not nanoseconds * remove metrics with label "all" * Add fixtures, update end-to-end for bcache collector * Move fixtures/sys into tar.gz This changeset moves the collector/fixtures/sys directory into collector/fixtures/sys.tar.gz and tweaks the Makefile to unpack the tarball before tests are run. The reason for this change is that Windows does not allow colons in a path (colons are present in some of the bcache fixture files), nor can it (out of the box) deal with pathnames longer than 260 characters (which we would be increasingly likely to hit if we tried to replace colons with longer codes that are guaranteed not the turn up in regular file names). * Add ttar: plain text archive, replacement for tar This changeset adds ttar, a plain text replacement for tar, and uses it for the sysfs fixture archive. The syntax is loosely based on tar(1). Using a plain text archive makes it possible to review changes without downloading and extracting the archive. Also, when working on the repo, git diff and git log become useful again, allowing a committer to verify and track changes over time. The code is written in bash, because bash is available out of the box on all major flavors of Linux and on macOS. The feature set used is restricted to bash version 3.2 because that is what Apple is still shipping. The programm also works on Windows if bash is installed. Obviously, it does not solve the Windows limitations (path length limited to 260 characters, no symbolic links) that prompted the move to an archive format in the first place.
Diffstat (limited to 'node_exporter.go')
-rw-r--r--node_exporter.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/node_exporter.go b/node_exporter.go
index f5ef01e..e8b5376 100644
--- a/node_exporter.go
+++ b/node_exporter.go
@@ -32,7 +32,7 @@ import (
32) 32)
33 33
34const ( 34const (
35 defaultCollectors = "arp,conntrack,cpu,diskstats,entropy,edac,exec,filefd,filesystem,hwmon,infiniband,loadavg,mdadm,meminfo,netdev,netstat,sockstat,stat,textfile,time,uname,vmstat,wifi,xfs,zfs" 35 defaultCollectors = "arp,bcache,conntrack,cpu,diskstats,entropy,edac,exec,filefd,filesystem,hwmon,infiniband,loadavg,mdadm,meminfo,netdev,netstat,sockstat,stat,textfile,time,uname,vmstat,wifi,xfs,zfs"
36) 36)
37 37
38var ( 38var (