Previously the raw time difference was used which includes the network trip time
between the node and the ntp server. This makes setting alerts off the value
troublesome as it depends on the latency as well as the clock offset.
logind provides a nice interface to find out about the numbers of sessions
on a system; it is used on most Linux distributions, even those which
aren't using systemd.
The exporter exposes the total number of sessions indexed by the following
attributes:
* seat
* type ("tty", "x11", ...)
* class ("user", "greeter", ...)
* remote ("true"/"false")
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.
When compiling `20ecedd0b4c983bd7b88f97cd7a21461988a6c12` with GNU make (`gmake`) on FreeBSD 10.2-RELEASE, I get the following error:
```
collector/filesystem_bsd.go:60: non-bool mnt[i].f_flags & MNT_RDONLY (type C.uint64_t) used as if condition
Makefile.COMMON:85: recipe for target 'node_exporter' failed
gmake: *** [node_exporter] Error 2
```
This problem is fixed by this patch.
It turns out, on some kernels (notably - CentOS6) there is an empty line
inserted at the beginning of /sys/devices/system/node/node*/meminfo
files. The leads to node_exporter crash on such kernels.
Fix this by checking for empty string first.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Add new collector which exposes the content of /sys/kernel/mm/ksm
directory. This directory contains control and statistics files for
Kernel Samepage Merging daemon.
The collector is not enabled by default.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Entry collector uses readUintFromFile() function which is defined by
conntrack collector. Thus, it is impossible to build node_exporter w/o
conntrack collector. Fix this by factoring out the function into
helper.go file.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
It is sometimes useful to understand the distribution of free/occupied
memory between NUMA nodes to deal with performance problems. To do so,
add new meminfo_numa collector that enables exporting of per node
statistics along with unit and end-to-end tests for it.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Removes unused signal handlers left over from signal based collection
and block the non windows-relevant collectors loadavg and interrupts.
Signal based collection removed in 1c17481a42.
As OS X doesn't have it's own interrupts provider, don't build
interrupts_common on OS X as well. Otherwise build fails, because
interrupts_common depends on variables provided by platform-specific
files.
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Current behaviour throws away all stats on any Statfs error. In practice
this is not useful. This turns such errors into debug log messages -
though silently ignoring them seems even more valid to me.
This test runs a selection of collectors against the fixtures and
compares the output to a reference.
The uname and filesystem collectors are disabled because they use system
calls that cannot be fixtured easily.
Remove all hardcoded references to `/proc`. For all collectors that do
not use `github.com/prometheus/procfs` yet, provide a wrapper to
generate the full paths.
Reformulate help strings, errors and comments to remove absolute
references to `/proc`.
This is a breaking change: the `-collector.ipvs.procfs` flag is removed
in favor of the general flag. Since it only affected that collector it
was only useful for development, so this should not cause many issues.
This creates a single metric like:
node_uname_info{domainname="(none)",machine="x86_64",nodename="desktop",release="3.16.0-48-generic",sysname="Linux",version="#64~14.04.1-Ubuntu SMP Thu Aug 20 23:03:57 UTC 2015"} 1
Fixed file-nr update function
Fixed file-nr test case
Fixed file-nr test case again
Fixed file-nr separator to tab
Updated file-nr to filenr.
Updated file-nr to filenr.
Fixed file-nr test cases, added comments
Remove reporting the second value from file-nr as it will alwasy be zero in linux 2.6 and greator
Renaming file-nr to filefd
Updated build constraint
Updates and code cleanup for filefd.
Updated enabledCollectors with the correct name for filefd
Fixed filefd test wording
initial work on sockstat work
Fixed package name
Finished implementation of the sockstat plugin
missed a return value
Added sockstat to default plugins to start
Fixed scanner read on sockstat
fixed sockstat linux test for TCP alloc
update sockstat test case
Updated sockstat to return TCP and UDP memory in bytes instead of page count
Collects more information for labelling scraped filesystems with the device
and fsType. This is useful for setting alerts which should change based on
filesystem type, or for filtering out shared mounts such as with NFS volumes.
This puts all collector-specific flags into their own namespace under
"collector.<collector-name>", and moves from camel case to dashes, which
is the standard in Prometheus land now.
Fixes issue described in #38
/proc/stat reports a blank line which needs to be ignored.
Old kernels misses one CPU time field, this needs to be ignored too.
This allows static metrics (e.g. an attributes collector replacement),
and cronjobs to expose stats by echoing into a file.
For example:
echo "my_metric 123" > mycronjob.prom.$$
mv mycronjob.prom.$$ mycronjob.prom
Remove special tags necessary for gmond and runit collectors. All
collectors get built. Selection of which collectors to use continues to
happen via parameter.
This catches things like listen overflows, retransmits
and other things that are very useful for retroactive debugging
thus I think it's justified to have it on by default.
Switch to Update using the Collecter Collect interface, due to not knowing all
metricnames in all modules beforehand we can't use Describe and thus the full
Collecter interface.
Remove 'updates', it's meaning varies by module and doesn't add much.
This collector exposes two metrics:
- net_bonding_slaves: configured slaves per bonding interface
- net_bonding_slaves_active: currently active slaves per bonding
interface
This collector exports the following metrics:
- raid_drive_temperature: drive temperature
- raid_drive_count: drive error and event counters
- raid_adapter_disk_presence: disk presence per adapter
Last login is disabled by default as it's broken on ubuntu 12.04
Interrupts is disabled by default as it's very granular and we'll have total interrupts from /proc/stat
Allow ignoring devices from diskstats, ignore ram and loop devices by default.
Use glog for logging.
Diskstats: Split out metrics, keep 'device' label
Meminfo: Split out metrics, one each. Convert kB to bytes.
Netstats: Split out metrics, keep 'device' label.
Interrupts: Stays the same. Not perfect, but should be rarely used.
Loadavg: Make it clear it's the 1m loadavg
Last seen: Not clear this belongs in the node exporter, as it's more a user
thing than a machine thing. Changed to absolute time rather than relative.
All stats now have appropriate counter/gauge type.
The gmond (Ganglia) exporter module exports many metrics not under our
control. They should all be prefixed in a common way to make it obvious
where they came from.
Fixes https://github.com/prometheus/node_exporter/issues/8