diff options
author | Calle Pettersson <carlpett@users.noreply.github.com> | 2017-09-28 15:06:26 +0200 |
---|---|---|
committer | Johannes 'fish' Ziemke <github@freigeist.org> | 2017-09-28 15:06:26 +0200 |
commit | 859a825bb84bf4fb911fcba445d410965945f088 (patch) | |
tree | 0726b08cf03c790bff3a34a085cecc01e3b927e2 /end-to-end-test.sh | |
parent | 3762191e66e309106e930ab11f9c080fb4428001 (diff) | |
download | prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.tar.bz2 prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.tar.xz prometheus_node_collector-859a825bb84bf4fb911fcba445d410965945f088.zip |
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
Diffstat (limited to 'end-to-end-test.sh')
-rwxr-xr-x | end-to-end-test.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/end-to-end-test.sh b/end-to-end-test.sh index 8698199..c1e45f6 100755 --- a/end-to-end-test.sh +++ b/end-to-end-test.sh | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | set -euf -o pipefail | 3 | set -euf -o pipefail |
4 | 4 | ||
5 | collectors=$(cat << COLLECTORS | 5 | enabled_collectors=$(cat << COLLECTORS |
6 | arp | 6 | arp |
7 | bcache | 7 | bcache |
8 | buddyinfo | 8 | buddyinfo |
@@ -36,6 +36,14 @@ collectors=$(cat << COLLECTORS | |||
36 | zfs | 36 | zfs |
37 | COLLECTORS | 37 | COLLECTORS |
38 | ) | 38 | ) |
39 | disabled_collectors=$(cat << COLLECTORS | ||
40 | filesystem | ||
41 | time | ||
42 | timex | ||
43 | uname | ||
44 | vmstat | ||
45 | COLLECTORS | ||
46 | ) | ||
39 | cd "$(dirname $0)" | 47 | cd "$(dirname $0)" |
40 | 48 | ||
41 | port="$((10000 + (RANDOM % 10000)))" | 49 | port="$((10000 + (RANDOM % 10000)))" |
@@ -74,13 +82,14 @@ then | |||
74 | fi | 82 | fi |
75 | 83 | ||
76 | ./node_exporter \ | 84 | ./node_exporter \ |
77 | --collector.procfs="collector/fixtures/proc" \ | 85 | --path.procfs="collector/fixtures/proc" \ |
78 | --collector.sysfs="collector/fixtures/sys" \ | 86 | --path.sysfs="collector/fixtures/sys" \ |
79 | --collectors.enabled="$(echo ${collectors} | tr ' ' ',')" \ | 87 | $(for c in ${enabled_collectors}; do echo --collector.${c} ; done) \ |
88 | $(for c in ${disabled_collectors}; do echo --no-collector.${c} ; done) \ | ||
80 | --collector.textfile.directory="collector/fixtures/textfile/two_metric_files/" \ | 89 | --collector.textfile.directory="collector/fixtures/textfile/two_metric_files/" \ |
81 | --collector.megacli.command="collector/fixtures/megacli" \ | 90 | --collector.megacli.command="collector/fixtures/megacli" \ |
82 | --collector.wifi="collector/fixtures/wifi" \ | 91 | --collector.wifi.fixtures="collector/fixtures/wifi" \ |
83 | --collector.qdisc="collector/fixtures/qdisc/" \ | 92 | --collector.qdisc.fixtures="collector/fixtures/qdisc/" \ |
84 | --web.listen-address "127.0.0.1:${port}" \ | 93 | --web.listen-address "127.0.0.1:${port}" \ |
85 | --log.level="debug" > "${tmpdir}/node_exporter.log" 2>&1 & | 94 | --log.level="debug" > "${tmpdir}/node_exporter.log" 2>&1 & |
86 | 95 | ||