Commit graph

1042 commits

Author SHA1 Message Date
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
Julius Volz 864a6ee935 Treat custom textfile metric timestamps as errors (#769)
This is clearer behavior and users will notice and fix their textfiles faster
than if we just output a warning.
2018-02-27 19:43:38 +01:00
Rene Treffer c504c7e264 Only report core throttles per core, not per cpu (#836)
* Only report core throttles per core, not per cpu

* Add topology/core_id to the cpu sysfs fixtures

* Add new cpu fixtures to ttar file

* Merge core_id reading and thermal throttle accounting

* Declare core_id
2018-02-27 19:43:15 +01:00
Ben Kochie e0d54a509c
Cleanup NFS metrics (#834)
* Cleanup NFS metrics

* Update `nfs` metric names to match `nfsd`.
* Remove uneeded `tcp` label from TCP connections metric.
* Remove uneeded `v` on `nfsd` metrics.
* Enable all `nfs` v4 client metrics.
* Remove `nfs` metric name overrides.

* Add ppc64le fixture.

* Fix typo.
2018-02-21 07:25:41 +01:00
Ben Kochie 3f41a2fecb
Update ppc64le fixture (#832)
Updates fixture for ppc64le arch to latest output.
2018-02-19 20:43:33 +01:00
Ben Kochie d33a447047
Remove deprecated prometheus.InstrumentHandlerFunc (#831)
Update Prometheus client golang use to use `promhttp.Handler()` instead
of `prometheus.InstrumentHandlerFunc()`.
2018-02-19 15:44:59 +01:00
Richard Elling d7348a5c78 updates for zfsonlinux 0.7.5 (#779)
* updates for zfsonlinux 0.7.5

* add constants for KSTAT_DATA_* types

* added e2e test for negative values represented by uint64 that can result from ZFS bugs
2018-02-16 15:46:31 +01:00
Ben Kochie 6468e7c80b
Enable NFS client metrics by default. (#828)
Enable NFS client metrics by default now that it nolonger prints errors
on scrape if there are no metrics to display.

Also fixup the nfsd README to match the nfs entry.
2018-02-16 15:42:47 +01:00
Ralf Horstmann 8d9c7ca659 Use swpginuse instead of swpgonly in meminfo_openbsd (#813)
All tools in OpenBSD base system use swpginuse instead of swpgonly
for reporting swap usage (snmpd, swapctl, top, vmstat), so let
memory collector use that as well for consistency.
2018-02-16 11:34:41 +01:00
Kasinath Kottukkal f6965e1812 Add overlay to defIgnoredFSTypes (#824)
* Add overlay to defIgnoredFSTypes

To avoid statfs() errors if node_exporter is running as non privileged user.

* Updated defIngoredFSTypes values in sorted order
2018-02-16 09:47:50 +01:00
Ben Kochie 01bd99fb1a
Refactor NFS client collector (#816)
* Update vendor github.com/prometheus/procfs/...

* Refactor NFS collector

Use new procfs library to parse NFS client stats.

* Ignore nfs proc file not existing.

* Refactor with reflection to walk the structs.
2018-02-15 13:40:38 +01:00
Brian Brazil 52c031890e
Add _seconds suffix to node_time. (#823) 2018-02-14 16:59:08 +00:00
Ben Kochie 05eabe60fb
Fix error output in nfsd collector. (#821) 2018-02-14 13:57:35 +01:00
Ben Kochie 3de2542d21
Fix NFSd metric type (#819)
RPC Count should be a counter, not a gauge.
2018-02-13 17:03:22 +01:00
Matt Layher 544488ddd6 Fix remaining metric naming issues (#799) 2018-02-12 18:53:31 +01:00
Ben Kochie 6a041692ed
Add NFS Server metrics collector. (#803)
* Add NFS Server metrics collector.

* Add File Handles metrics.

* Add nfsd IO stats.

* Add metrics for NFSd threads.

* Add metrics for NFSd read ahead cache.

* Add NFSd network traffic counters.

* Add RPC metrics.

* Add V2 requests metrics.

* Add NFSv3 metrics.

* Add NFSv4 metrics.

* Update reply cache comment.

* Update help text.
2018-02-12 17:56:05 +01:00
Brian Brazil 1072f2868d Fix log level regression in #533 2018-02-07 15:16:20 +00:00
Brian Brazil 7e41a2b279 Ignore /var/lib/docker by default. (#814)
The node exporter runs unprivileged, so it cannot statfs any filesystems
under this directory causing log spam.  In addition there tends to be
high churn in the filesystems here (as it's basically application
monitoring) which can cause high cardinaltiy and in one case caused
Prometheus's index symbol table to get very large.
Accordingly this should be ignored to reduce log spam and avoid
performance issues. The filesystems themselves can in principle be
monitored via container oriented exporters, and the underlying
filesystems will still be monitored.
2018-02-06 17:10:59 +01:00
Ralf Horstmann 29ac809e48 Use unified CPU metric description on OpenBSD (#810) 2018-02-01 23:59:19 +01:00
Derek Marcotte fde5d2c6c9 Remove unsafe typecasts from sysctl_bsd getStructTimeval. (#741)
There is a simpler way.
2018-02-01 18:43:40 +01:00
Ben Kochie 14d60958d6
Unify CPU collector conventions (#806)
* Unify CPU collector conventions

Add a common CPU metric description.
* All collectors use the same `nodeCpuSecondsDesc`.
* All collectors drop the `cpu` prefix for `cpu` label values.

* Fix subsystem string in cpu_freebsd.

* Fix Linux CPU freq label names.
2018-02-01 18:42:20 +01:00
Ralf Horstmann e3c76b1f0c Add OpenBSD CPU collector (#805) 2018-02-01 18:33:49 +01:00
Tom Wilkie 6833eec187 Fix tests. 2018-01-31 15:22:17 +00:00
Tom Wilkie 0316bacceb Only use one dbus connection, required some refactoring. 2018-01-31 15:19:18 +00:00
Tom Wilkie a7fd6b8743 Export systemd timer last trigger sec. 2018-01-31 15:07:04 +00:00
Ben Kochie 111e3af437
Remove obsolete megacli collector. (#798)
This collector has been replaced by the textfile collector tool
`storcli.py`.
2018-01-23 11:25:42 +01:00
Julius Volz 6cac74f0e0
Add unit suffix to textfile collector mtime metric (#796) 2018-01-22 14:02:19 +01:00
Brian Brazil a98067a294 Make metrics better follow guidelines (#787)
* Improve stat linux metric names.

cpu is no longer used.

* node_cpu -> node_cpu_seconds_total for Linux

* Improve filesystem metric names with units

* Improve units and names of linux disk stats

Remove sector metrics, the bytes metrics cover those already.

* Infiniband counters should end in _total

* Improve timex metric names, convert to more normal units.

See
3c073991eb/kernel/time/ntp.c (L909)
for what stabil means, looks like a moving average of some form.

* Update test fixture

* For meminfo metrics that had "kB" units, add _bytes

* Interrupts counter should have _total
2018-01-17 17:55:55 +01:00
Ben Kochie b4d7ba119a
Add fixture for ppc64le (#785)
* Add support for per-architecture fixtures.
* Add output for ppc64le.
2018-01-11 13:56:19 +01:00
Nick Owens 0629a081db multiply page size after float64 coercion to avoid signed integer overflow (#780) 2018-01-08 15:36:49 +01:00
Franz Pletz d432f9857e Use uint64 in the ZFS collector (#714)
ZFS metrics can also be unsigned 64-bit integers that won't fit in
int64 and causes the whole collector to fail.
2018-01-06 12:36:55 +01:00
Derek Marcotte 477fe4665a Move FreeBSD/DragonflyBSD out of meminfo add kvm. (#547)
* Move FreeBSD/DragonflyBSD out of meminfo add kvm.

This gives us SwapUsed, and everything under one roof.

* Fix typos per review.

* Update to use newer API.

* Remove premature optimization per PR feedback.
2018-01-04 12:23:26 +01:00
Sevag Hanssian 4329b0a86b Add summary metrics for systemd exporter (#765) 2018-01-04 11:49:36 +01:00
Matthieu Guegan d6ef10bb56 Add openbsd meminfo (#724)
* Implements meminfo collector for OpenBSD

This is a rework of #151.

* Fix CGO import

* Add some useful metrics

* Rename total -> size for normalization
2018-01-04 10:32:08 +01:00
Ben Kochie 7f6c59e198
Ignore more virtual filesystems (#775)
Add additional Linux virtual filesystem types to the default list.
2018-01-03 17:22:02 +01:00
Netmonk 2aa8d0eb0c [FIX] Exclude Linux proc from filesystem type regexp (#774)
* [FIX] Issue 63, error on excluding proc filesystem on linux, improving regexp

* [FIX] Reordering filter order
2018-01-03 11:40:32 +01:00
Julius Volz f536857ac6
Fix e2e tests after textfile custom timestamp removal (#768) 2017-12-24 11:54:33 +01:00
Shubheksha Jalan 1f2458f42c Filter out testfile metrics correctly when using collect[] filters (#763)
* remove injection hook for textfile metrics, convert them to prometheus format

* add support for summaries

* add support for histograms

* add logic for handling inconsistent labels within a metric family for counter, gauge, untyped

* change logic for parsing the metrics textfile

* fix logic to adding missing labels

* Export time and error metrics for textfiles

* Add tests for new textfile collector, fix found bugs

* refactor Update() to split into smaller functions

* remove parseTextFiles(), fix import issue

* add mtime metric directly to channel, fix handling of mtime during testing

* rename variables related to labels

* refactor: add default case, remove if guard for metrics, remove extra loop and slice

* refactor: remove extra loop iterating over metric families

* test: add test case for different metric type, fix found bug

* test: add test for metrics with inconsistent labels

* test: add test for histogram

* test: add test for histogram with extra dimension

* test: add test for summary

* test: add test for summary with extra dimension

* remove unnecessary creation of protobuf

* nit: remove extra blank line
2017-12-23 20:21:58 +01:00
Ben Kochie cd2a17176a
Add full make to CircleCI (#761)
* Add full make to CircleCI

Ensure end-to-end test is run.

* Fix go fmt error.

* Fix end-to-end output.
2017-12-21 16:24:23 +01:00
Wei Li 1e9bb4ec3a textfile: fix duplicate metrics error (#738)
The textfile gatherer should only be added to gatherer list once.

Signed-off-by: Li Wei <liwei@anbutu.com>
2017-12-06 17:05:40 +01:00
Kristian Klausen a96f1738b3 netdev: Change valueType to CounterValue (#749)
All the metric only goes up, so the type should be counter.
This also add _total to all the metric name.

Fix: #747
2017-12-06 13:58:35 +01:00
Ben Kochie 2a80537547
Split out guest cpu metrics on Linux. (#744)
Linux "guest" metrics for VMs are already accounted for in node_cpu
`user` and `nice` metrics.  Separate these into their own metric to
avoid duplication of data.
2017-11-23 15:04:47 +01:00
Karsten Weiss a8d7d1101a cpu: Support processor-less (memory-only) NUMA nodes (#734)
* cpu: Support processor-less (memory-only) NUMA nodes

Processor-less (memory-only) NUMA nodes exist e.g. in systems that use
Intel Optane drives for RAM expansion using Intel Memory Drive
Technology (IMDT).

IMDT RAM expansion supports two modes:

* "Unify Remote Memory domains": present a processor-less (memory-only)
  NUMA domain, which is the default
* "Expand local memory domains": to expand each processor’s memory domain
  with a portion of the memory made available by Optane and IMDT

This commit fixes a crash in the first case (when "cpulist" is empty).

Here's an example of such a system:

$ numastat -m|head -n5

Per-node system memory usage (in MBs):
                          Node 0          Node 1          Node 2           Total
                 --------------- --------------- --------------- ---------------
MemTotal               118239.56       130816.00       464384.00       713439.56

$ for i in {0..2}; do echo -n "$i: " ; cat /sys/bus/node/devices/node$i/cpulist ; done
0: 0-7,16-23
1: 8-15,24-31
2:

$ /opt/vsmp/bin/vsmpversion -vvv
Memory Drive Technology: 8.2.1455.74 (Sep 28 2017 13:09:59)
System configuration:
    Boards:      3
       1 x Proc. + I/O + Memory
       2 x NVM devices (Intel SSDPED1K375GAQ)
    Processors:  2, Cores: 16, Threads: 32
        Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz Stepping 01
    Memory (MB): 713472 (of 977450), Cache: 251416, Private: 12562
       1 x 249088MB   [262036/   678/12270]
       1 x 232192MB   [357707/125369/  146]  82:00.0#1
       1 x 232192MB   [357707/125369/  146]  83:00.0#1

* cpu: rename some variables (pkg => node)

* cpu: Use %v not %q in log.Debugf() format strings
2017-11-10 15:31:26 +01:00
Matt Layher f6f9c8d6cc Add and use sysReadFile in hwmon collector (#728) 2017-11-07 07:49:37 +01:00
Tobias Klauser d73f1e60c4 Simplify Utsname string conversion (#716)
* Update golang.org/x/sys/unix

This allows to use simplified string conversion of Utsname members.

* Simplify Utsname string conversion

Use Utsname from golang.org/x/sys/unix which contains byte array
instead of int8/uint8 array members. This allows to simplify the string
conversions of these members.
2017-11-02 11:57:14 +01:00
Ben Kochie ea250d73f4
Fix off by one in Linux interrupts collector (#721)
* Fix off by one in Linux interrupts collector

* Fix off by one in CPU column handler.
* Add test.

* Enable interrupts in end-to-end test.
2017-11-02 09:59:46 +01:00
Matt Layher 296b62acb7
netstat: return nothing when /proc/net/snmp6 not found 2017-10-31 15:26:32 -04:00
Derek Marcotte 0eecaa9547 Correct buffer_bytes > INT_MAX on BSD/amd64. (#712)
* Correct buffer_bytes > INT_MAX on BSD/amd64.

The sysctl vfs.bufspace returns either an int or a long, depending on
the value.  Large values of vfs.bufspace will result in error messages
like:

  couldn't get meminfo: cannot allocate memory

This will detect the returned data type, and cast appropriately.

* Added explicit length checks per feedback.

* Flatten Value() to make it easier to read.

* Simplify per feedback.

* Fix style.

* Doc updates.
2017-10-25 20:55:22 +02:00
Matt Layher f9ad88fc03
xfs: expose correct fields, fix metric names 2017-10-20 18:41:51 -04:00
Siavash Safi f3a7022602 Add collect[] parameter (#699)
* Add `collect[]` parameter

* Add TODo comment about staticcheck ignored

* Restore promhttp.HandlerOpts

* Log a warning and return HTTP error instead of failing

* Check collector existence and status, cleanups

* Fix warnings and error messages

* Don't panic, return error if collector registration failed

* Update README
2017-10-14 14:23:42 +02:00
Ben Kochie deadfef4c9 Update vendoring (#685)
* Update vendor github.com/coreos/go-systemd/dbus@v15

* Update vendor github.com/ema/qdisc

* Update vendor github.com/godbus/dbus

* Update vendor github.com/golang/protobuf/proto

* Update vendor github.com/lufia/iostat

* Update vendor github.com/matttproud/golang_protobuf_extensions/pbutil@v1.0.0

* Update vendor github.com/prometheus/client_golang/...

* Update vendor github.com/prometheus/common/...

* Update vendor github.com/prometheus/procfs/...

* Update vendor github.com/sirupsen/logrus@v1.0.3

Adds vendor golang.org/x/crypto

* Update vendor golang.org/x/net/...

* Update vendor golang.org/x/sys/...

* Update end to end output.
2017-10-05 16:20:47 +02:00
Brett Vickers b62c7bc0ad Updated vendored ntp package (#681)
The github.com/beevik/ntp package was recently updated with some
API changes that broke node_exporter. This commit fetches the
latest version of the ntp package and brings node_exporter in
line with the latest API.
2017-10-04 08:33:49 +02:00
Calle Pettersson 859a825bb8 Replace --collectors.enabled with per-collector flags (#640)
* Move NodeCollector into package collector

* Refactor collector enabling

* Update README with new collector enabled flags

* Fix out-of-date inline flag reference syntax

* Use new flags in end-to-end tests

* Add flag to disable all default collectors

* Track if a flag has been set explicitly

* Add --collectors.disable-defaults to README

* Revert disable-defaults flag

* Shorten flags

* Fixup timex collector registration

* Fix end-to-end tests

* Change procfs and sysfs path flags

* Fix review comments
2017-09-28 15:06:26 +02:00
Sami Kerola 3762191e66 Add timex collector (#664)
This collector is based on adjtimex(2) system call.  The collector returns
three values, status if time is synchronised, offset to remote reference,
and local clock frequency adjustment.

Values are taken from kernel time keeping data structures to avoid getting
involved how the synchronisation is implemented.  By that I mean one should
not care if time is update using ntpd, systemd.timesyncd, ptpd, and so on.
Since all time sync implementation will always end up telling to kernel what
is the status with time one can simply omit the software in between, and
look results of the syncing.  As a positive side effect this makes collector
very quick and conceptually specific, this does not monitor availability of
NTP server, or network in between, or dns resolution, and other unrelated
but necessary things.

Minimum set of values to keep eye on are the following three:

    The node_timex_sync_status tells if local clock is in sync with a remote
    clock.  Value is set to zero when synchronisation to a reliable server
    is lost, or a time sync software is misconfigured.

    The node_timex_offset_seconds tells how much local clock is off when
    compared to reference.  In case of multiple time references this value
    is outcome of RFC 5905 adjustment algorithm.  Ideally offset should be
    close to zero, and it depends about use case how large value is
    acceptable.  For example a typical web server is probably fine if offset
    is about 0.1 or less, but that would not be good enough for mobile phone
    base station operator.

    The node_timex_freq tells amount of adjustment to local clock tick
    frequency.  For example if offset is one second and growing the local
    clock will need instruction to tick quicker.  Number value itself is not
    very important, and occasional small adjustments are fine.  When
    frequency is unusually in stable one can assume quality of time stamps
    will not be accurate to very far in sub second range.  Obviously
    explaining why local clock frequency behaves like a passenger in roller
    coaster is different matter.  Explanations can vary from system load, to
    environmental issues such as a machine being physically too hot.

Rest of the measurements can help when debugging.  If you run a clock server
do probably want to collect and keep track of everything.

Pull-request: https://github.com/prometheus/node_exporter/pull/664
2017-09-19 07:54:06 -07:00
Leonid Evdokimov c169b4b1c5 Add metrics from SNTPv4 packet to ntp collector & add ntpd sanity check (#655)
* Add metrics from SNTPv4 packet to ntp collector & add ntpd sanity check

1. Checking local clock against remote NTP daemon is bad idea, local
ntpd acting as a  client should do it better and avoid excessive load on
remote NTP server so the collector is refactored to query local NTP
server.

2. Checking local clock against remote one does not check local ntpd
itself. Local ntpd may be down or out of sync due to network issues, but
clock will be OK.

3. Checking NTP server using sanity of it's response is tricky and
depends on ntpd implementation, that's why common `node_ntp_sanity`
variable is exported.

* `govendor add golang.org/x/net/ipv4`, it is dependency of github.com/beevik/ntp

* Update github.com/beevik/ntp to include boring SNTP fix

* Use variable name from RFC5905

* ntp: move code to make export of raw metrics more explicit

* Move NTP math to `github.com/beevik/ntp`

* Make `golint` happy

* Add some brief docs explaining `ntp` #655 and `timex` #664 modules

* ntp: drop XXX comment that got its decision

* ntp: add `_seconds` suffix to relevant metrics

* Better `node_ntp_leap` comment

* s/node_ntp_reftime/node_ntp_reference_timestamp_seconds/ as requested by @discordianfish

* Extract subsystem name to const as suggested by @SuperQ
2017-09-19 10:36:14 +02:00
Karsten Weiss b0d5c00832 cpu: Metric 'package_throttles_total' is per package. (#657)
* cpu: Metric 'package_throttles_total' is per package.

'package_throttles_total' is per package, not per cpu. This also reduces
the total number of cpu time series a lot (esp for multi core cpus).

* cpu: Better handling of a cpulist edge-case.

* cpu: Extract the package number from the directory name.

Do not rely on the range index.

* cpu: Add package_throttle_count for node0 cpu1

This file must be ignored by the cpu collector.
2017-09-07 23:24:18 +02:00
Matthias Rampke e1f129c729 Use int64 throughout the ZFS collector.
This avoids issues with integer overflows on 32-bit architectures. The
Prometheus data format is float64, so regardless of the architecture we
should handle large numbers.

Fixes #629.
2017-08-21 16:40:16 +00:00
Ben Kochie 8839640cd1 Ignore wifi collector permission errors (#646)
Ignore the permission denined error when the wifi collector has no
permission to read metrics.
2017-08-18 10:19:48 +02:00
Calle Pettersson dfe07eaae8 Switch to kingpin flags (#639)
* Switch to kingpin flags

* Fix logrus vendoring

* Fix flags in main tests

* Fix vendoring versions
2017-08-12 15:07:24 +02:00
Ben Kochie 46c31d8a7e Enable IPVS collector by default (#623)
* Silence error output when no IPVS present.
* Enable by default.
* Update end-to-end fixture.
* Update README.
2017-07-26 15:20:28 +02:00
Tobias Schmidt 515b5a933d Fix build tags of loadavg collector
The collector is only implemented for a subset of all operating systems
supported by go. Compilation will fail if attempted for another OS
target.
2017-07-20 15:13:58 -04:00
Tobias Schmidt 016d79535d Fix build tags of meminfo collector
The meminfo collector only supports darwin, dragonfly, freebsd and linux
and must not be included in other archtictures.
2017-07-20 14:37:10 -04:00
Andrea De Pasquale 1369763067 Change raid0 status line regexp for mdadm collector (#619) 2017-07-20 17:04:33 +02:00
Tobias Schmidt 921319c7eb Merge pull request #583 from knweiss/golint
Golint fixes
2017-07-10 23:49:36 +02:00
Aleksey Zhukov 7a914e58f2 Add parsing /proc/net/snmp6 file for netstat-linux (#615)
* Add parsing /proc/net/snmp6 file

* add /proc/net/snmp6 fixture

* fix e2e test

* gofmt

* remove unuser variable

* safe checks

* add tests

* change help format
2017-07-08 20:16:35 +02:00
Matt Layher 6e82fd1c56 Add XFS block mapping and block map B-tree stats (#575) 2017-07-07 07:27:52 +02:00
ideaship 8d90276283 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.
2017-07-07 07:20:18 +02:00
kadota kyohei a077024f51 add diskstats on Darwin (#593)
* Add diskstats collector for Darwin

* Update year in the header

* Update README.md

* Add github.com/lufia/iostat to vendored packages

* Change stats to follow naming guidelines

* Add a entry of github.com/lufia/iostat into vendor.json

* Remove /proc/diskstats from description
2017-07-06 13:51:24 +02:00
Rene Treffer 56bf8d4b2d Add link to kernel documentation for sysfs/cpufreq files 2017-06-27 11:25:06 +02:00
Rene Treffer bcc3cd92b8 Fix cpufreq statistics by converting kHz to Hz 2017-06-27 11:05:55 +02:00
Ben Kochie 182810056f Fix Linux cpu errors (#606)
Make the Linux cpu collector soft-error on missing `cpufreq` and
`thermal_throttle` features.
2017-06-20 07:51:26 +02:00
Rene Treffer 2e9f1913b8 Move stat_linux to cpu_linux and add cpufreq stats (#548) 2017-06-13 11:21:53 +02:00
Emanuele Rocca 047003b6bb Add qdisc collector for Linux (#580)
* Add qdisc collector for Linux

This collector gathers basic queueing discipline metrics via netlink,
similarly to what `tc -s qdisc show` does.

* qdisc collector: nl-specific code moved, names fixed

- netlink-specific parts moved to github.com/ema/qdisc
- avoid using shortened names
- counters renamed into XXX_total

* Get rid of parseMessage error checking leftover

* Add github.com/ema/qdisc to vendored packages

* Update help texts and comments

* Add qdisc collector to README file

* qdisc collector end-to-end testing

* Update qdisc dependency to latest version

Update github.com/ema/qdisc dependency to revision 2c7e72d, which
includes unit testing.

* qdisc collector: rename "iface" label into "device"
2017-05-23 11:55:50 +02:00
Karsten Weiss b2f4fd5776 Remove unused devstatCollector struct member 'bytes_total'.
This also fixes this golint issue:

devstat_freebsd.go:40:2: don't use underscores in Go names; struct field bytes_total should be bytesTotal
2017-05-14 19:51:53 +02:00
Jonas Große Sundrup e6d031788f Correct typo (#582) 2017-05-14 19:46:23 +02:00
Karsten Weiss bca09abf1c golint: Fix NewStatCollector() doc string. 2017-05-14 13:51:47 +02:00
Karsten Weiss b3e7420a27 cpu_darwin.go: s/cpu_ticks/cpuTicks/g 2017-05-14 13:51:42 +02:00
Karsten Weiss b05c7d8dab cpu_darwin.go: Fix doc strings. 2017-05-14 13:51:34 +02:00
Karsten Weiss fff03c6c0c Fix NewTCPStatCollector doc string. 2017-05-14 13:23:57 +02:00
Karsten Weiss 6720cfdbfe golint: Fix comment on exported function NewDevstatCollector. 2017-05-14 13:21:39 +02:00
Karsten Weiss b73af72853 Explicitly check for the rc 3 in call to getloadavg(). Reorder logic. 2017-05-14 13:07:54 +02:00
Karsten Weiss af358ec800 golint fixes: if block ends with a return statement, so drop this else and outdent its block. 2017-05-14 12:55:44 +02:00
Karsten Weiss 732f839810 sysctl_bsd.go: golint fixes. Typo fix. 2017-05-14 12:51:57 +02:00
Robert Clark 58f50b31f2 Multiply port data XMIT/RCV metrics by 4 (#579)
According to Mellanox, it is standard practice that the port_xmit_data and port_rcv_data
files are split into 4 lanes. To get the actual transmit and receive values for each
port, the metric needs to be multiplied by 4.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-05-12 07:28:53 +02:00
Ben Kochie 8f3cddf734 Merge pull request #568 from mdlayher/xfs-init
Initial XFS collector
2017-04-25 09:54:28 +02:00
Kai S 59f9b8c5c1 Handle nonexisting bonding_masters file (#569)
* silently ignore nonexisting bonding_masters file

Add an empty fixtures dir without a bonding_masters file to test.

* Moved the check to the Update() method

Dropped the empty test dir.
2017-04-24 23:19:17 +04:00
Matt Layher 1feb091b36
Initial XFS collector 2017-04-22 11:53:07 -04:00
Ben Kochie e9aad0157c Merge pull request #550 from derekmarcotte/dm-boottime
Add exec_boot_time for freebsd, dragonfly
2017-04-22 09:18:05 +02:00
Derek Marcotte 5b557bf973 Fix metric name per review. 2017-04-21 16:25:31 -04:00
Derek Marcotte db8ec9c6b4 Add exec_boot_time for freebsd, dragonfly
Adds new sysctl type, bsdSysctlTypeStructTimeval to enable parsing of
timevals from raw memory.
2017-04-21 10:23:19 -04:00
Daniele Sluijters bb9d4ade0b uname_linux: Build for 32bit MIPS too
Since Go 1.8 32bit MIPS Big/Little Endian are supported assuming the
target runs Linux and the kernel either emulates an FPU or can access
the CPU one.

This allows the node_collector to build for mips and mipsle opening up
the possibility of running it on things like home routers
(DD-|Open|ASUS-)Wrt firmware usually has the necessary bits in place.
2017-04-20 13:30:40 +02:00
Brian Brazil f291d2d6dd Get full resolution for node_time (#555) 2017-04-19 18:31:21 +01:00
Karsten Weiss d9703ff7c6 edac: Fix typo in csrow label of node_edac_csrow_uncorrectable_errors_total metric. 2017-04-18 12:45:06 +02:00
Tobias Schmidt 266f0958d2 Merge pull request #561 from derekmarcotte/dm-fix-dfly-build
Fixes broken build on Dragonfly.
2017-04-17 17:31:12 +02:00
Derek Marcotte 83cecfa696 Fixes broken build on Dragonfly.
Undefined err:

84eaa8fecd/collector/devstat_dragonfly.go (L145)
2017-04-17 10:50:49 -04:00
Karsten Weiss 45ca8db352 Support the 'guest_nice' cpu mode of /proc/stat.
'guest_nice' is available since Linux 2.6.33.
2017-04-14 12:50:37 +02:00
Sam Kottler 6eafa51fa8 Add ARP collector for Linux (#540)
* Implement commonalities and linux support for ARP collection

* Add ARP collector to fixtures and run as part of e2e tests

* Bubble up scanner errors

* Use single return values where it makes sense

* Add missing annotation

* Move arp_common into arp_linux

* Add license header to arp_linux.go

* Address initial feedback

* Use strings.Fields instead of strings.Split

* Deal with scanner.Err() rather than throwing away errors

* Check for scan errors in-line before interacting with the entries map

* Don't interact with potentially empty text from scan

* Check for scan errors outside the scan loop

* Add comment about moving procfs parsing

* Add more direct comment

* Update initialism style to match go style guide

* Put function args on the same line

* Add TODO in front of comment about procfs extraction

* Guard against strings.Fields returning an empty slice

* Be more defensive about ARP table format and use upcase more broadly

* Enable the ARP collector by default

* Add ARP collector to the README

* Remove 'entry'
2017-04-11 17:45:19 +02:00
Tobias Schmidt 8aec44617a Remove Windows support
Use https://github.com/martinlindhe/wmi_exporter instead.
2017-04-10 23:27:23 -03:00
Tobias Schmidt 41a44a4d24 Merge pull request #532 from prometheus/grobie/remove-extra-file-check
mdadm: Remove extra file existence check
2017-03-31 05:35:12 +02:00
Ben Kochie 5f43211f67 Blacklist systemd scope units
Blacklist `scope` units from systemd collector by default.

These units are created with unique IDs programatically[0].  This leads to
huge cardinality problems.

[0]: https://www.freedesktop.org/software/systemd/man/systemd.scope.html
2017-03-23 14:02:46 +01:00
Tobias Schmidt d290ea94b8 Fix export of stale device error metrics for unmounted filesystems
Instead of maintaining a counter metric for device errors in memory,
this change exports a gauge and uses const metrics to avoid leaking
metrics for unmounted filesystems.
2017-03-22 21:48:18 -03:00
Tobias Schmidt 7b93b52010 Fix lint issues on filesystem BSD implementation 2017-03-22 21:48:12 -03:00
Tobias Schmidt 445ed44082 mdadm: Remove extra file existence check 2017-03-22 10:11:19 -03:00
Johannes 'fish' Ziemke 9676f5f2dc Merge pull request #523 from roclark/support-legacy-infiniband
Add support for legacy InfiniBand drivers
2017-03-21 10:52:07 +01:00
Johannes 'fish' Ziemke 620e9937e6 Merge pull request #524 from mdlayher/wifi-expand
Expand wifi collector for more interface types
2017-03-21 10:32:44 +01:00
Juergen Hoetzel aef2601cf6 Add missing dependency for static FreeBSD build 2017-03-20 16:59:45 +00:00
Matt Layher 2bfe410fb7
Expand wifi collector for more interface types 2017-03-20 12:25:01 -04:00
Robert Clark 3a5917dfdc Add support for legacy InfiniBand drivers
Older versions of the OFED drivers contain 64-bit variants of the port counters and are located in a directory named 'counters_ext'. This patch includes these older metrics that have since been deprecated with OFED 4.0.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-03-20 10:37:21 -05:00
Tobias Schmidt 0400e437be Fix and simplify parsing of raid metrics
Fixes the wrong reporting of active+total disk metrics for inactive
raids. Also simplifies the code and removes a couple of redundant
comments.
2017-03-19 08:03:58 -03:00
Matt Layher 42c8a20545
Unexport wifiCollector metrics 2017-03-16 17:11:09 -04:00
Matt Layher 69368b7f9c Add synthetic node_wifi_station_info metric for BSS information 2017-03-16 16:24:23 -04:00
Brian Brazil a02e469b07 Report collector success/failure and duration per scrape. (#516)
This is in line with best practices, and also saves us
63 timeseries on a default Linux setup.
2017-03-16 17:21:00 +00:00
Robert Clark 413e5af502 Skip metric files that don't exist
In case a metric file within the InfiniBand collector doesn't exist, skip the metric in order to allow collection of the remaining valid InfiniBand metrics.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-03-09 11:05:36 -06:00
Derek Marcotte 72d8576185 Refactor meminfo_bsd.go to use sysctl_bsd.go (#501)
* Refactor meminfo_bsd.go to use sysctl_bsd.go

* Fixed spelling.
2017-03-07 21:54:28 -04:00
Ben Kochie 5d22d41ed7 Merge pull request #484 from prometheus/grobie/update-vendored-packages
Update vendored packages
2017-03-01 08:05:45 +01:00
Derek Marcotte bdc2131332 Added node_memory_buffer, node_memory_swaptotal to meminfo_bsd (#451) 2017-03-01 01:36:02 -04:00
Tobias Schmidt ce117d7a40 Update vendored packages 2017-02-28 18:20:24 -04:00
Tobias Schmidt 84eaa8fecd Remove more unnecessarily named return values 2017-02-28 17:33:46 -04:00
Derek Marcotte 5c28ab044d Add BSD exec statistics collector (#457)
* First pass of a sysctl_bsd source, exec_bsd + exec metrics

* Incorportate PR feedback, including removing pre-build descriptions, unit conversion callback.

* Remove redundant cached_description field, per PR feedback

* Incorporate PR feedback
2017-02-28 17:23:10 -04:00
Tobias Schmidt 1bd94074dd Delete unused code 2017-02-28 17:20:16 -04:00
Tobias Schmidt 922e74d58f Remove unnecessarily named return variables
Named return variables should only be used to describe the returned type
further, e.g. `err error` doesn't add any new information and is just
stutter.
2017-02-28 16:04:25 -04:00
Tobias Schmidt 084e585c2a Fix scanner usage without error handling 2017-02-28 16:04:25 -04:00
Tobias Schmidt d1dfda86ee Fix wrong end-to-end expectation 2017-02-28 16:02:43 -04:00
Tobias Schmidt abdebef47c Fix gofmt -s and spelling issues 2017-02-28 14:01:28 -04:00
Tobias Schmidt 195b4d596c Merge pull request #480 from prometheus/grobie/gosimple
Simplify go code
2017-02-28 13:59:01 -04:00
Tobias Schmidt 694294baf5 Remove unnecessary conversions 2017-02-28 13:57:49 -04:00
Tobias Schmidt 21e13c7f52 Simplify code 2017-02-28 13:54:27 -04:00
Tobias Schmidt c703435790 Fix all open go lint and vet issues 2017-02-28 13:05:38 -04:00
Ben Kochie 38cd07ebb9 Merge pull request #450 from roclark/add-infiniband
infiniband: Add new collector for InfiniBand statistics
2017-02-16 14:33:19 +01:00
Ben Kochie a097dd36b3 Merge pull request #459 from joehandzik/wip-zpool-io-cherrypick
ZFS Collector: Add zpool IO statistics
2017-02-16 08:16:55 +01:00
Thorhallur Sverrisson 19813d3e02 Changing datastructure for BuddyInfo 2017-02-15 10:15:44 -06:00
Thorhallur Sverrisson 5ab285e098 Adding buddyinfo to end to end test. 2017-02-15 10:15:44 -06:00
Thorhallur Sverrisson 55417d7688 Moving buddyinfo logic to procfs 2017-02-15 10:15:44 -06:00
Thorhallur Sverrisson 492c96f6b6 Moving buddyinfo_test.go to procfs library 2017-02-15 10:15:43 -06:00
Thorhallur Sverrisson 3ba15c1ddb Adding support for /proc/buddyinfo for linux free memory fragmentation.
/prod/buddyinfo returns data on the free blocks fragments available
for use from the kernel.  This data is useful when diagnosing
possible memory fragmentation.

More info can be found in:
* https://lwn.net/Articles/7868/
* https://andorian.blogspot.com/2014/03/making-sense-of-procbuddyinfo.html
2017-02-15 10:15:43 -06:00
Joe Handzik bb8b3fca88 ZFS Collector: Add zpool IO statistics
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-02-10 13:31:25 -06:00
Robert Clark 36f81282b7 Add unit tests for InfiniBand collector
Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-02-07 11:09:08 -06:00
Robert Clark 4866adcb71 Add new collector for InfiniBand statistics
Add new metrics for the InfiniBand network protocol including the amount of packets sent and received, the number of times the link has been downed and how many times the link has recovered from an error state.

Signed-Off-By: Robert Clark <robert.d.clark@hpe.com>
2017-02-07 11:09:08 -06:00
Joe Handzik 8c23f5ff54 ZFS Collector: Convert dashes to underscores for metrics
This fixes #442, and prevents other ZFS metrics from slipping through in the future.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-31 14:11:56 -06:00
Ben Kochie 7cfa5e75b8 Merge pull request #439 from mdlayher/collector-staticcheck
Fix two staticcheck issues in IPVS collector tests
2017-01-31 08:53:10 -05:00
Ben Kochie 71362d45eb Merge pull request #432 from joehandzik/wip-zfs-zfetchstats
Update ZFS Collector with most non-zpool metrics
2017-01-31 08:52:41 -05:00
Joe Handzik e5ee274a32 ZFS Collector: Move from camelcase to underscores for metric prefixes
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-29 15:59:01 -06:00
Matt Layher c8e546926a
Fix two staticcheck issues in IPVS collector tests 2017-01-27 15:20:36 -05:00
Joe Handzik e213ccbc57 ZFS Collector: Refactor to use maps/slices and fewer globals
Removed all global types that were unnecessary, and refactored to use constructor-created values and inline values instead of globals.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-27 14:02:28 -06:00
Ben Kochie 5a6db5c8d2 Handle multiple NFS device mounts
It's possible to mount an NFS share in multiple locations.
* Duplicates contain the same metric values, so they can be ignored.
* Update fixture.
2017-01-24 13:44:08 +01:00
Joe Handzik 94fb93a9f3 ZFS Collector: Add dmu_tx functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:41:15 -06:00
Joe Handzik 07c7ae733a ZFS Collector: Add fm functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:31:22 -06:00
Joe Handzik 05048c067d ZFS Collector: Add xuio_stats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:30:37 -06:00
Joe Handzik 3c9e779989 ZFS Collector: Add vdev_cache_stats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:29:50 -06:00
Joe Handzik a02ca9502c ZFS Collector: Add zil functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:29:00 -06:00
Joe Handzik a3125ab4d9 ZFS Collector: Add zfetchstats functionality
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-23 16:28:11 -06:00
Ben Kochie acb495ccab Merge pull request #425 from mdlayher/wifi-update
Update vendored wifi, handle stations with missing info
2017-01-20 08:43:44 -05:00
Matt Layher dfd661a633
Allow graceful failure in hwmon collector 2017-01-17 11:24:28 -05:00
Matt Layher ca3f07feef
Update vendored wifi, handle stations with missing info 2017-01-17 00:54:18 -05:00
Ben Kochie 92537020a3 Fix runit collector flag typo. 2017-01-16 23:41:33 +01:00
Julius Volz 276112c7ef Merge pull request #418 from mdlayher/wifi-graceful-fail
Make wifi collector fail gracefully if metrics not available
2017-01-13 20:31:21 -05:00
Matt Layher d3089f2ce8
Make wifi collector fail gracefully if metrics not available 2017-01-13 13:35:20 -05:00
Matt Layher 1e1775e761
Make ZFS collector fail gracefully when not available 2017-01-12 12:54:16 -05:00
Johannes 'fish' Ziemke 2884181cce Merge pull request #415 from mdlayher/mountstats-nfs-additional
Add NFS event metrics to mountstats collector
2017-01-12 14:08:21 +01:00
Matt Layher e3f99e13b9
Add NFS event metrics to mountstats collector 2017-01-11 11:41:13 -05:00
Matt Layher efa25665ec
Add initial wifi collector, bump netlink to fix 32-bit builds 2017-01-11 10:08:44 -05:00
Johannes 'fish' Ziemke 55170e8feb Merge pull request #411 from discordianfish/hwmon-move-label-metrics
Use filename as label, move 'label' to own metric
2017-01-10 12:21:18 +01:00
Ben Kochie 38a4a36061 Update end-to-end test. 2017-01-10 10:23:16 +01:00
Ben Kochie b4fa10ca9d Add collector for Linux EDAC
Collect "Error detection and correction" metrics from memory
controllers.
* Supported on Linux only.
* Add basic fixtures.
* Enabled by default.
2017-01-10 10:14:19 +01:00
Johannes 'fish' Ziemke 6aef20f8d8 Use filename as label, move 'label' to own metric
This closes #406
2017-01-09 18:33:31 +01:00
Joe Handzik e7442d6517 end-to-end-test.sh: Add zfs plugin
Enables fixture test and updates e2e-output.txt.

Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-08 11:13:35 -06:00
Corey Stewart 10ba27bf2c Remove FreeBSD support for zfs plugin.
This also involves removing zfs_zpool code for now.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
2017-01-08 11:13:35 -06:00
Corey Stewart a8c94d48e6 Style changes and cleanup
This patch makes stylistic changes to error strings, unexports method names by lower casing them, removes unused dataSetMetric, and adds copyright/licence information.

Signed-Off-By: Corey Stewart <stewa169@purdue.edu>
2017-01-08 10:23:58 -06:00
Christian Schwarz f29f3873ea Add a collector for ZFS, currently focussed on ARC stats.
It is tested on FreeBSD 10.2-RELEASE and Linux (ZFS on Linux 0.6.5.4).

On FreeBSD, Solaris, etc. ZFS metrics are exposed through sysctls.
ZFS on Linux exposes the same metrics through procfs `/proc/spl/...`.

In addition to sysctl metrics, 'computed metrics' are exposed by
the collector, which are based on several sysctl values.
There is some conditional logic involved in computing these metrics
which cannot be easily mapped to PromQL.

Not all 92 ARC sysctls are exposed right now but this can be changed
with one additional LOC each.
2017-01-08 10:23:58 -06:00
Johannes 'fish' Ziemke 2e47fcb8c5 Only store relevant e2e output
This makes commits ligher/more readable when updating the output.
2017-01-06 12:36:26 +01:00
Johannes 'fish' Ziemke ad2eb4a788 Use Gauge for megacli counters
Without refactoring this to use const metrics, we need to make this a
gauge to we can keep using Set() which was deprecated for counters.
2017-01-06 12:33:21 +01:00
Johannes 'fish' Ziemke 01a9a37556 Stop using deprecated SetMetricFamilyInjectionHook 2017-01-06 12:21:12 +01:00
Johannes 'fish' Ziemke 3e266e28b9 Merge pull request #397 from dominikh/freebsd-cpu
Collect CPU temperatures on FreeBSD
2017-01-05 17:32:48 +01:00
Johannes 'fish' Ziemke fc1113cd11 Merge pull request #396 from dominikh/bsd-memleak
Don't leak or race in FreeBSD devstat collector
2017-01-05 17:31:57 +01:00
Dominik Honnef d827db8e17 Better error handling when collecting CPU temps
Log why we couldn't collect the temperature, and set metric to NaN if
the CPU should support temperature collection but had an error.
2017-01-05 15:19:56 +01:00
Johannes 'fish' Ziemke 91f4781234 Merge pull request #311 from kpettijohn/solaris-loadavg
Added loadavg collector for Solaris
2017-01-05 11:49:16 +01:00
Dominik Honnef 9847257bc0 Add missing license headers 2017-01-05 06:18:34 +01:00
Dominik Honnef 782eaee100 Collect CPU temperatures on FreeBSD 2017-01-05 06:17:16 +01:00
Dominik Honnef 38c5890428 Reuse devinfo struct
The devstat API expects us to reuse one devinfo for many invocations of
devstat_getstats. In particular, it allocates and resizes memory
referenced by devinfo.
2017-01-05 05:38:26 +01:00
Dominik Honnef ea55d0f5cb Don't race in FreeBSD devstat collector
Querying the number of devices separately from the device list itself is
racy. Devices may be added or removed between the two calls; and removed
devices would lead to a segfault.
2017-01-05 05:38:26 +01:00
Dominik Honnef 5e220c1665 Move cgo portions of FreeBSD devstat collector into own file
Embedding 100 lines of code in a comment doesn't make for good reading,
editing or code quality.
2017-01-05 05:38:26 +01:00
Dominik Honnef 20ca0f1376 Eliminate memory leak in FreeBSD devstat collector
The memory allocated by calloc was never freed. Since the devinfo struct
never leaves the function, anyway, we might as well just allocate it on
the stack.
2017-01-05 05:38:26 +01:00
Dominik Honnef 732dd67729 Fix build of cpu_freebsd.go
Corrects an incorrect merge in 8e50b80
2017-01-05 03:16:51 +01:00
Kevin Pettijohn d2fbeeb3c3 Added loadavg collector for solaris
It seems solaris prefers "sys/loadavg.h" over "stdlib.h" when
fetching the load average.

For Illumos based OSes it was required to include "sys/time.h" to
ensure that "hrtime_t" was defined.

https://www.illumos.org/issues/6002

It also required setting the ldflags "-fno-stack-protector -lssp" to
avoid undefined symbols when linking with gcc.

/opt/local/go/pkg/tool/solaris_amd64/link: running gcc failed: exit status 1
Undefined                       first referenced
 symbol                             in file
 __stack_chk_fail                    /tmp/go-link-138622936/000002.o
 __stack_chk_guard                   /tmp/go-link-138622936/000002.o
2017-01-04 17:45:40 -08:00
Johannes 'fish' Ziemke f9d3f830cb Merge pull request #399 from discordianfish/fish-fs-uniq-metric
Make sure we only return one metric per mounted fs
2017-01-04 16:48:04 +01:00
Johannes 'fish' Ziemke 4c9131b7d8 Make sure we only return one metric per mounted fs 2017-01-04 16:45:25 +01:00
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
Anton Tolchanov fc3a7b7a97 Add NTP stratum to NTP collector 2016-06-03 13:25:30 +03:00
Chris Batey 387c64424b Use the offset calculation that includes round trip time in the ntp collector
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.
2016-06-01 08:56:20 +01:00
Sharif Nassar bf88b6ee0f Fix typos, and initialisms from comments in #217 2016-05-13 13:40:14 -07:00
Dominik Schulz 3fe5e7f8fa Add ignored fs types 2016-05-13 13:40:14 -07:00
Tobias Schmidt 3d81f25fdd Merge pull request #224 from giganteous/test-freebsd-netdev
Add a unit test for the conversion
2016-05-05 01:12:52 -04:00
Tobias Schmidt 6683a89f9e Merge pull request #226 from giganteous/fix-386-on-freebsd
Fix compilation on freebsd/386
2016-05-05 01:08:14 -04:00
Steve Durrheimer 60cbc9efc0
Make version informations consistent between prometheus components
This also fixes #231 by adding the '-version' flag
2016-05-04 08:43:33 +02:00
Julius Volz c3b16c7b2e Remove lastlogin collector.
See also https://github.com/prometheus/node_exporter/issues/229
2016-04-24 18:30:15 +02:00
Kai Storbeck 53d0a7815b Add a unit test for the conversion 2016-04-21 23:45:34 +02:00
Matthias Schiffer 91ddafdb33 Add 'logind' exporter
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")
2016-04-20 17:28:12 +02:00
Kai Storbeck dcfbf40dbf change caps of the constant 2016-04-20 00:22:47 +02:00
Kai Storbeck 365e688cec gofmt, a typo, and an unintended change crept in 2016-04-20 00:19:16 +02:00
Kai Storbeck aac89c524e This should fix it. 2016-04-20 00:08:26 +02:00
Kai Storbeck 1122ce49c7 fix the uint conversion to strings 2016-04-16 14:39:55 +02:00
Christoph Hack 5d35401a41 systemd-collector: support private/direct connections without dbus 2016-03-29 16:19:47 +02:00
Christian Svensson fff0298c68 Fix NTP server command line reference
--ntpServer is actually -collector.ntp.server
2016-02-20 22:04:49 +01:00
Christian Schwarz 1fc84e2fb6 Re-implement CPU metrics collection through sysctls.
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.
2016-02-17 15:39:21 +01:00
Christian Schwarz 2ca6280b82 Fix compile error on FreeBSD
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.
2016-02-17 15:39:21 +01:00
Carlos Amedee 8578a3281a fix a small typo in an error message. 2016-02-09 23:22:29 -05:00
Pavel Borzenkov 5a085dcaf5 meminfo_numa: fix crash on CentOS 6 kernel
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>
2016-02-06 16:11:49 +03:00
Tobias Schmidt e2163db0f7 Document os support of each collector 2016-01-21 19:36:58 -05:00
Tobias Schmidt 041de0e30c Fix go format style in filesystem collector 2016-01-21 16:20:32 -05:00
Tobias Schmidt d1f0f2247d Merge pull request #165 from pborzenkov/ksmd-collector
Add new collector exposing 'ksmd' stats
2016-01-21 08:48:47 -05:00
Tobias Schmidt 4d07881b5b Merge pull request #162 from wrouesnel/read_only_flag
Add filesystem read-only metric.
2016-01-21 08:43:54 -05:00
Pavel Borzenkov 0e78ed63a6 Add new collector exposing 'ksmd' stats
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>
2016-01-21 13:43:22 +03:00
Tobias Schmidt c47c011063 Fix go format style in mdadm collector 2016-01-21 00:44:07 -05:00
Tobias Schmidt f6f4fda1aa Merge pull request #168 from pborzenkov/per-numa-meminfo
Add new per NUMA node memory statistics collector
2016-01-20 23:43:24 -05:00
afefelov 00e1db52bb Fix mdstat for devices in delayed resync state
In some raid configurations resync will be delayed for devices allocated
on the same physiclal units.

Fixes #170.
2016-01-20 23:35:39 -05:00
Juergen Hoetzel 4c909d4793 Disable compilation of vmstat on !Linux target OS 2016-01-19 17:43:02 +01:00
Juergen Hoetzel e3437dc583 Fix build on 32-bit architectures 2016-01-19 17:21:47 +01:00
Pavel Borzenkov 21d473ffd4 Fix compilation without conntrack collector
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>
2016-01-15 15:16:12 +03:00
Pavel Borzenkov c12d8ea927 Add new per NUMA node memory statistics collector
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>
2016-01-15 15:04:27 +03:00
Björn Rabenstein fae388dcab Merge pull request #191 from erkki/fix_filefd
fix block nesting bug
2016-01-14 15:15:08 +01:00
Richard Hartmann e8fdc4d160 collector/entropy_linux.go: Use canonical name for available entropy 2016-01-14 08:26:04 +01:00
Richard Hartmann aee580d8d8 Introduce entropy collector for Linux 2016-01-13 18:29:52 +01:00
Erkki Eilonen ff7106615e fix block nesting bug causing filefd values to never be updated post initial call 2016-01-13 21:09:01 +07:00
Florian Koch 5d5346af8a Add vmstat collector, enabled per default 2016-01-11 07:58:30 +01:00
Caskey L. Dickson ab9ee574fb Build cleanly under windows.
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.
2016-01-07 17:59:16 -08:00
Juergen Hoetzel e02d99ebff Fix compilation on FreeBSD. Refs #139
There is no interrupts_freebsd.go implementation yet.
2016-01-07 19:25:30 +01:00
Daniel Bechler fc3931c924 Add build_info metric similar to the one of Prometheus itself 2016-01-06 23:54:33 +01:00
Peter Fern 09e610ad37 Calculate Linux disk bytes read/written based on sector size (512B)
Logical sector size appears to be fixed at 512B for the foreseeable
future in the kernel, so for now we just hard-code it.
2015-12-27 22:00:02 +11:00
Brian Brazil a82b4c30cb Add linux conntrack collector. 2015-12-20 00:57:52 +00:00
Julius Volz 613f531280 Merge pull request #174 from audebert/systemd
collector: add systemd services status
2015-12-19 16:19:19 +01:00
Rémi Audebert 8628d60125 collector: systemd: collect whether the system is operational 2015-12-19 13:54:20 +01:00
Rémi Audebert 87ccaa39c9 collector: add systemd 2015-12-19 13:54:20 +01:00
Brian Brazil 2f0d697f8c Do a make format run. 2015-12-18 14:08:52 +00:00
Brian Brazil 7739fb4e12 Switch linux stat to using ConstMetric 2015-12-18 12:28:51 +00:00
Brian Brazil 6e20d89467 Merge pull request #169 from pborzenkov/ntp-fix-missing-arg
Add missing argument to fmt.Errorf function in 'ntp' collector
2015-11-13 15:13:02 +00:00
Pavel Borzenkov d773360d12 Add missing argument to fmt.Errorf function in 'ntp' collector
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2015-11-13 18:09:11 +03:00
Pavel Borzenkov d1789be33e Fix compilation on OS X
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>
2015-11-12 18:17:32 +03:00
Will Rouesnel 05539ee156 Add filesystem read-only metric node_filesystem_readonly
This is a boolean metric which is set to 1 when the filesystem is flagged as
read-only.
2015-11-12 14:11:07 +11:00
Bruno Bigras f74de8943b Fix flag name in textfile.go 2015-11-10 15:45:50 -05:00
Julius Volz 07b39499cd Fix protocol version setting in NTP collector.
The upstream library changed their interface - the global Version
variable is gone:

283ed9d548
2015-11-10 10:08:57 +01:00
Tobias Schmidt b11cd9c7d4 Merge pull request #158 from mischief/interrupts-openbsd
collector: add openbsd support to interrupt collector
2015-11-06 22:26:09 -05:00
Tobias Schmidt fe40d8fce2 Merge pull request #159 from mischief/netdev-openbsd
collector: add openbsd support for netdev
2015-11-06 19:05:21 -05:00
Nick Owens 3eb2d6625a collector: add openbsd support for netdev 2015-11-06 15:29:57 -08:00
Nick Owens 73ee8f5257 collector: add openbsd support to interrupt collector 2015-11-06 14:49:04 -08:00
Mikhail Salosin e7359706d4 Do not use flag before flag.Parse() was called 2015-11-06 19:45:05 +03:00
Nick Owens ebf3ef32f1 collector: sync bsd filesystem collector labels with linux 2015-11-02 19:16:17 -08:00
Nick Owens b58d1fc971 collector: add openbsd suport to filesystem colector 2015-11-01 19:17:11 -08:00
Nick Owens 2cb489253c collector: support 1,5,15m load averages for all unices 2015-10-31 06:04:24 -07:00
Nick Owens eb79937340 switch to github.com/prometheus/common/log for logging 2015-10-30 13:20:06 -07:00
Mikhail Salosin 10e65086ea Add NTP protocol version flag 2015-10-26 16:15:53 +03:00
Julius Volz 00e5d1334b Merge pull request #142 from crisidev/master
Add load5 and load15 to linux load metric
2015-10-21 23:26:02 +02:00
Matteo Bigoi e6ffeb4907 Reduce nesting in sanity check 2015-10-21 15:38:26 +00:00
Matteo Bigoi 8913d71ca4 Update end-to-end output for testing 2015-10-19 19:31:54 +00:00
Matteo Bigoi 5918be9a8c Fix documentation and a possible slice bounds out of range 2015-10-19 19:31:31 +00:00
Kevin Lyda 36291d456e Make filesystem collector more robust.
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.
2015-10-18 19:47:45 +01:00
Matteo Bigoi 832ba9cc1d Add load5 and load15 to linux load metric 2015-10-17 13:07:39 +00:00
Tobias Schmidt 0faa12cacd Update end-to-end fixtures 2015-10-16 18:53:44 -04:00
Tobias Schmidt 500340bdde Remove logging in IPVS tests 2015-10-16 18:53:44 -04:00
Tobias Schmidt 7e2b65f942 Clean up lint errors 2015-10-16 18:53:44 -04:00
Brian Brazil 07022b3555 Fix compilation on linux/arm64 2015-10-15 08:44:49 +01:00
Brian Brazil 59f1949a76 Merge pull request #135 from prometheus/remove-unneeded-make
Remove unneeded `make` in empty slice initialization.
2015-10-11 21:44:46 +01:00
Julius Volz a25751e0b3 Fix occurreneces of initial uppercase in error strings. 2015-10-11 22:37:43 +02:00
Julius Volz 777a8ddd90 Remove unneeded make in empty slice initialization. 2015-10-11 22:37:34 +02:00
Ilia Choly 9c0302571f Add supervisord collector 2015-10-06 11:50:54 -04:00
Tobias Schmidt 52f79e699d Fix uname collector for arm/ppc64/ppc64le architectures
The syscall.Utsname struct under arm/ppc64/ppc64le uses uint8 type
instead of int8.
2015-10-03 16:17:15 -04:00
Kirk Russell 88c30557c0 Fixed minor compile time error 2015-10-01 18:42:25 -04:00
Harmen 5d6fb852bb fix copy-paste error in comment
Comment seems to be copied from netdev_linux.go, where it is correct.
2015-09-29 20:52:33 +02:00
Matthias Rampke 7c47338081 Add an end-to-end test.
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.
2015-09-28 13:56:22 +00:00
Matthias Rampke 788ac9a859 Rearrange fixtures to match "real" proc and sys.
And add some missing fixtures for default collectors, even if they're
not read by tests yet.
2015-09-28 13:56:22 +00:00
Matthias Rampke 85eb47197f Add a flag for the sysfs location.
Analogous to `collector.procfs`, but for `/sys`. Add tests for both.
2015-09-28 13:56:22 +00:00
Matthias Rampke 24c9db9600 Suppress log noise from textfile collector test. 2015-09-28 13:56:22 +00:00
Matthias Rampke 60dffaa9ff Fix mdadm collector.
In the move to the procfs flag, I accidentally changed the filename.
2015-09-28 13:56:22 +00:00
Kirk Russell 89875cefe8 converted freebsd cpu metrics to seconds 2015-09-26 20:58:47 -04:00
Matthias Rampke 2d0d72b97d Add license headers to all code files. 2015-09-26 17:44:39 +02:00
Matthias Rampke 20b551ab2b Add flag to change the location of the procfs.
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.
2015-09-26 15:32:10 +02:00
Björn Rabenstein cf3aa37f1a Merge pull request #120 from prometheus/move-to-common
Move from client_golang/text to common/expfmt
2015-09-17 14:38:27 +02:00
beorn7 8f182d2f02 Move from client_golang/text to common/expfmt 2015-09-17 14:05:56 +02:00
Julius Volz 7de03b8d6b Merge pull request #119 from AlphaB/issue-95
Resolve go vet problems
2015-09-17 11:44:46 +02:00
Björn Rabenstein ca74e8ab3e Merge pull request #117 from TheTincho/forget-old-filesystems
Revamp the filesystem collector to use throw-away ConstMetrics.
2015-09-16 17:31:06 +02:00
Martín Ferrari e3f217ea45 Build filesystem_common only on linux and freebsd. 2015-09-16 18:15:27 +03:00
Julius Volz d8bf6daed9 Merge pull request #118 from TheTincho/forget-old-netdevs
Revamp the netdev collector to use throw-away ConstMetrics.
2015-09-16 16:36:16 +02:00
Martín Ferrari 0161a36fa5 Fix formatting and variable names. 2015-09-16 17:06:59 +03:00
Martín Ferrari dace6dc48b Fix issues from code review, and split common code into filesystem_common.go. 2015-09-16 16:34:34 +03:00
Mikhail Salosin e41593de14 Add unix timestamp of the last service state change to runit collector 2015-09-15 19:46:59 +03:00
Martín Ferrari 13672ced48 Revamp the netdev collector to use throw-away ConstMetrics. 2015-09-15 15:31:51 +00:00
Mikhail Salosin 741fb66e1c Resolve go vet problems
Issue prometheus/node_exporter#95
2015-09-15 17:09:10 +03:00
Martín Ferrari 8c2316e8a9 Revamp the filesystem collector to use throw-away ConstMetrics. 2015-09-15 12:17:15 +00:00
Jonas Große Sundrup 9f2aa24e12 Add collector for metrics of linux software raids 2015-09-11 18:36:39 +02:00
Julius Volz 7b39ccc144 Add Linux uname collector.
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
2015-09-11 14:32:18 +02:00
Julius Volz 02956d2bcc Merge pull request #114 from chosenken/sockstat
Fixed sockstat test wording
2015-09-10 17:15:21 +02:00
Ken Herner 7569c6ce23 Initial implementation of file-nr
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
2015-09-10 10:27:58 -04:00
Ken Herner d6a1f0c7e3 Fixed sockstat test wording 2015-09-10 10:21:19 -04:00
Julius Volz 6f17231e44 Minor comment cleanups. 2015-09-10 12:21:25 +02:00
Julius Volz dd5fc6a3ca Merge pull request #111 from chosenken/sockstat
Implementation of /proc/net/sockstat collector
2015-09-10 12:19:47 +02:00
Ken Herner d4adef9881 Added new metric mem_bytes that reports the number of bytes used by TCP/UDP memory 2015-09-09 14:05:16 -04:00
Ken Herner 60a57a15d5 Updated sockstat build constraint 2015-09-09 12:37:48 -04:00
Ken Herner 356e1bb866 Added sockstat test file
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
2015-09-09 10:48:17 -04:00
Julius Volz e13f910427 Fix mtime reporting in textfile collector, add tests. 2015-09-04 15:42:44 +02:00
Alexey Palazhchenko 38e6e6b672 Fix debug output 2015-08-28 08:54:36 +03:00
Alexis Letessier 0028abc077 megacli: prevent crash when drive temperature is N/A
Intel SSD do not report their temperature in MegaCLI output
Drive Temperature : N/A
2015-07-29 08:34:02 +02:00
Jari Takkala 21ce0cbda9 Add support for stats from /proc/net/snmp as well. 2015-07-15 12:39:28 -04:00
Siavash Safi 8c4a5b0f65 stats: Fix formatting. 2015-07-14 17:27:20 +04:30
Siavash Safi dddb273dfc Fix some error messages. 2015-07-14 13:58:54 +04:30
Siavash Safi 93708f3dda devstat: Fix metric types, disable free metrics. 2015-07-14 13:58:53 +04:30
Siavash Safi f8ede82488 cpu: Fix build constraints. 2015-07-14 13:58:53 +04:30
Siavash Safi 9e66d4f2ae meminfo: Code cleanup. 2015-07-14 13:58:52 +04:30
Siavash Safi d303a2ebc3 loadavg: Fix build constraints. 2015-07-14 13:58:52 +04:30
Siavash Safi d80b2af492 loadavg: Split the collector for linux and other platforms. 2015-07-14 13:58:51 +04:30
Siavash Safi 720198e047 netdev: Code cleanup. 2015-07-14 13:58:51 +04:30
Siavash Safi 78bf63ffd8 filesystem: Code cleanup. 2015-07-14 13:58:50 +04:30
Siavash Safi 462b708742 cpu: Code cleanup. 2015-07-14 13:58:50 +04:30
Siavash Safi f93125ba10 loadavg: Remove unnecessary global variable. 2015-07-14 13:58:49 +04:30
Siavash Safi ccbea34465 filesystem: Remove unused const variable. 2015-07-14 13:58:49 +04:30
Siavash Safi 71abff14b1 devstat: Fix wrong labels for 'other' metrics. 2015-07-14 13:58:49 +04:30
Siavash Safi c5669f0a1a Add devstat collector for FreeBSD. 2015-07-14 13:58:48 +04:30
Siavash Safi f7563fe7a2 Remove config from collectors. 2015-07-14 13:58:48 +04:30
Siavash Safi 1ebda4c0aa Remove linux build contraint from meminfo test source code. 2015-07-14 13:58:48 +04:30
Siavash Safi 9b6843db60 netdev: use counters instead of gauges. 2015-07-14 13:58:47 +04:30
Siavash Safi c651d7ccd9 meminfo: use bytes, fix type conversion bug. 2015-07-14 13:58:47 +04:30
Siavash Safi a10ab2c102 Check caller's euid and egid when accessing /dev/mem on FreeBSD. 2015-07-14 13:58:47 +04:30
Siavash Safi 6ef3b7a4e8 Add filesystem collector for FreeBSD. 2015-07-14 13:58:46 +04:30
Siavash Safi 13d5f969a5 Removed freebsd build constraints from source code. 2015-07-14 13:58:46 +04:30
Siavash Safi ae5aea0191 Add netdev collector for FreeBSD. 2015-07-14 13:58:46 +04:30
Siavash Safi 66e0171159 Rename linux collectors for build constraints. 2015-07-14 13:58:45 +04:30
Siavash Safi d7ec7eac1f Revert "Add build constraint for linux collectors." 2015-07-14 13:58:44 +04:30
Siavash Safi 4c5db2787e Add meminfo collector for FreeBSD. 2015-07-14 13:58:44 +04:30
Siavash Safi ad73b87d1e Add build constraint for linux collectors. 2015-07-14 13:58:44 +04:30
Siavash Safi 23bb9c44b9 Add cpu collector for FreeBSD. 2015-07-14 13:58:43 +04:30
Siavash Safi f9fa6d05cf loadavg: Use getloadavg() from stdlib.h 2015-07-14 13:58:42 +04:30
Ian Hansen 64affe205b Allows netdev devices to be ignored 2015-07-13 17:18:34 -06:00
Will Rouesnel 676ed5c6ac Change "filesystem" to "mountpoint" to better reflect the new labels. 2015-07-07 02:40:19 +10:00
William Rouesnel b22d2e9739 Add device,fsType collection to the filesystem exporter.
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.
2015-07-03 11:05:03 +10:00
Julius Volz e65bc868fc Switch logging from glog to github.com/prometheus/log. 2015-05-28 21:34:02 +02:00
Julius Volz 9f046cd88e Run gofmt. 2015-05-28 21:22:03 +02:00
Julius Volz b539481503 Merge pull request #75 from prometheus/remove-attribute-module
Use flags instead of config and remove attributes
2015-05-21 11:49:01 +02:00
Johannes 'fish' Ziemke 665b05eedc Use flags instead of config and remove attributes 2015-05-21 11:36:56 +02:00
Julius Volz 072ddabf62 Fix /proc/net/dev column parsing.
This fixes https://github.com/prometheus/node_exporter/issues/73
2015-05-21 01:01:15 +02:00
Matthias Rampke 2ee8470004 remove cgo dependency
by hardcoding `USER_HZ` (aka. `_SC_CLK_TCK`) to 100, which it is for all
platforms Go supports. See prometheus/node_exporter#52 for discussion around this too.

Closes prometheus/node_exporter#52.
2015-05-12 14:24:48 +00:00
Matthias Rampke 37c7e5e60f Add IPVS stats collector.
This collector exposes IPVS status from `/proc/net/ip_vs` and stats from
`/proc/net/ip_vs_stats`.

Note that it is _not_ tested with IPv6, YMMV.
2015-05-08 14:02:47 +00:00
Julius Volz 3ab0b1f915 Merge pull request #56 from kjmkznr/add-tcp-stat-collector
Add TCP state collector
2015-03-24 12:50:26 +01:00
KOJIMA Kazunori e4da771b21 Add collector for /proc/net/tcp 2015-03-24 20:34:48 +09:00
Benjamin Staffin df7ba0af85 Switch protobuf import to its new github URL 2015-03-22 12:25:07 -07:00
Julius Volz efcce45c90 Make collector-specific flags consistent with others.
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.
2015-02-18 18:42:39 +01:00
Stephen Shirley 54da76f575 Match fd0, not fda0
Add fd/sr/vda examples to test input
2015-02-18 17:10:28 +01:00
Stephen Shirley 686a0c768c Fix typo, match fd0, not fdd0 2015-02-18 16:09:41 +01:00
Stephen Shirley 72404d9ed1 Ignore floppy disk devices, due to it being 2015 2015-02-18 16:04:53 +01:00
Stephen Shirley 0c7d45cc5d Also ignore vda1 and friends 2015-02-18 15:44:30 +01:00
Daniel Speichert 1763908013 Fixed panic when parsing /proc/stat on 2.6.32-25-pve
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.
2015-02-07 06:36:36 +01:00
Brian Brazil 352cde6d20 Add text file exporter
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
2015-01-25 16:25:25 +00:00
Tobias Schmidt 0aacec2335 Fix ganglia namespace
Remove double underscore usage.
2014-11-26 18:15:02 -05:00
Tobias Schmidt 74971c46ba Consolidate build flags
The build of any collector can be deactivated by using "no<name>".
2014-11-25 18:01:02 -05:00
Tobias Schmidt 211ddf33f1 Consolidate collector selection
Remove special tags necessary for gmond and runit collectors. All
collectors get built. Selection of which collectors to use continues to
happen via parameter.
2014-11-25 18:01:02 -05:00
Tobias Schmidt 872f921867 Reduce number of global variables used
This is the first step to make the exporter more testable.
2014-11-24 21:08:50 -05:00
Tobias Schmidt 974f6fc762 Fix tests 2014-11-24 18:34:02 -05:00
Brian Brazil 96eaff8c7e Add an exporter for /proc/net/netstat, enabled by default.
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.
2014-11-11 16:54:08 +00:00
Brian Brazil 1c17481a42 Collect at every scrape, rather than at regular intervals.
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.
2014-10-29 17:00:36 +00:00
Johannes 'fish' Ziemke 9f6fc576df Look for slave_ and lower_ prefixed device in proc
Looks like on newer kernels this is prefixed lower_ not slave_.
2014-10-03 14:29:38 +02:00
Johannes 'fish' Ziemke 0bf0f67503 Add network bonding collector
This collector exposes two metrics:

- net_bonding_slaves: configured slaves per bonding interface
- net_bonding_slaves_active: currently active slaves per bonding
  interface
2014-08-14 15:45:17 +02:00
Johannes 'fish' Ziemke b03ff7cb9b Fix format string in test 2014-08-13 13:36:16 +02:00
Johannes 'fish' Ziemke 2b3a112b54 Add time exporter
This simple exporter exposes the systems unix time. It's useful to
compare it to the prometheus server time and other targets to detect
clock skew.
2014-07-28 13:02:48 +02:00
Johannes 'fish' Ziemke 32724a10b0 Add NTP exporter
This exporter gets the time from a NTP server and exposes the offset
between the remote and local system time.
2014-07-28 13:02:46 +02:00
Johannes 'fish' Ziemke 053db59122 Change metric prefix from raid to megacli 2014-07-09 18:47:17 +02:00
Johannes 'fish' Ziemke 50c66918d8 Merge pull request #18 from prometheus/add-megaraid-metrics
Add MegaCLI collector
2014-07-09 14:56:52 +02:00
Johannes 'fish' Ziemke f47abc5d06 Add MegaCLI collector
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
2014-07-09 14:56:06 +02:00
Johannes 'fish' Ziemke 7cb4c0edb6 Fix tests 2014-07-04 18:44:51 +02:00
Bjoern Rabenstein 28468bebae Now also migrate gmond and runit. 2014-06-26 21:16:21 +02:00
Bjoern Rabenstein 0563ecd29d Migrated everything to new client_golang. 2014-06-26 19:20:36 +02:00
Brian Brazil c0f10e3a6d Update comment format. 2014-06-06 11:38:34 +01:00
Brian Brazil 09a3de1669 Changes per code review. 2014-06-06 10:53:40 +01:00
Brian Brazil 062443133e Add collector for /proc/stat, enabled by default.
This gives cpu stats, boot time, context switches, forks.
2014-06-06 10:37:16 +01:00
Brian Brazil 3f0814f13b Add filesystem collector module, to report space used etc. 2014-06-05 20:46:11 +01:00
Brian Brazil b98ac0b050 Also ignore xvda1, as seen on AWS 2014-06-05 14:23:13 +01:00
Brian Brazil f9c6e4ca52 Ignore disk partitions by default, it's the disks themselves you usually want. 2014-06-05 11:44:44 +01:00
Brian Brazil 25ea90369c Split native collector into it's component parts and make them enablable.
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.
2014-06-04 12:37:25 +01:00
Brian Brazil 964cdbfcc9 Trim down a bit per feedback. 2014-05-23 15:53:31 +01:00
Brian Brazil ffc811b337 Expand docs per code review. 2014-05-23 15:38:44 +01:00
Brian Brazil 6cdaf0e969 Change stats to follow name guidelines.
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.
2014-05-23 14:41:43 +01:00
Julius Volz a22036788a Prefix Ganglia metrics with "ganglia_".
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
2014-04-10 12:34:39 +02:00
Johannes 'fish' Ziemke 3a4aa70afb Make collector testable and add native test 2014-02-18 14:53:48 +01:00
Johannes 'fish' Ziemke 3ac5222f8b Move exporter to main and listen/interval to flags 2014-02-18 13:57:41 +01:00