fixes + go version bump in __prometheus_exporter

This commit is contained in:
Kamila Souckova 2017-09-09 12:05:40 +02:00
parent f08ac264a0
commit 909431c269
2 changed files with 21 additions and 15 deletions

View file

@ -16,6 +16,13 @@ Daemontools (or something compatible) must be installed (in particular, the comm
This type installs and builds the latest version from git, using go get. A recent version of golang as well This type installs and builds the latest version from git, using go get. A recent version of golang as well
as build tools (make, g++, etc.) must be available. as build tools (make, g++, etc.) must be available.
Currently supported exporters:
- node
- blackbox
- ceph
REQUIRED PARAMETERS REQUIRED PARAMETERS
------------------- -------------------
None None

View file

@ -10,41 +10,40 @@ __user prometheus --system
case $exporter in case $exporter in
node) node)
TEXTFILES=/service/node-exporter/textfiles # path for the textfiles collector TEXTFILES=/service/node-exporter/textfiles # path for the textfiles collector
__directory $TEXTFILES --parents --mode 777
require="$require __golang_from_vendor" __go_get github.com/prometheus/node_exporter
port=9100 port=9100
run="setuidgid prometheus $GOBIN/node_exporter -web.listen-address :$port -collector.textfile.directory=$TEXTFILES" run="setuidgid prometheus $GOBIN/node_exporter -web.listen-address :$port -collector.textfile.directory=$TEXTFILES"
require="__golang_from_vendor" __go_get github.com/prometheus/node_exporter
__directory $TEXTFILES --parents --mode 777
;; ;;
blackbox) blackbox)
port=9115 require="$require __daemontools_service/${exporter}-exporter __user/prometheus" __config_file "/service/${exporter}-exporter/blackbox.yml" \
run="setuidgid prometheus $GOBIN/blackbox_exporter -config.file=/service/blackbox-exporter/blackbox.yml"
require="__daemontools_service/blackbox-exporter __user/prometheus" __config_file "/service/blackbox-exporter/blackbox.yml" \
--source $__type/files/blackbox.yml \ --source $__type/files/blackbox.yml \
--group prometheus --mode 640 \ --group prometheus --mode 640 \
--onchange "svc -h /service/blackbox-exporter" --onchange "svc -h /service/${exporter}-exporter"
require="__golang_from_vendor" __go_get github.com/prometheus/blackbox_exporter require="$require __golang_from_vendor" __go_get github.com/prometheus/blackbox_exporter
port=9115
run="setuidgid prometheus $GOBIN/blackbox_exporter -config.file=/service/${exporter}-exporter/blackbox.yml"
;; ;;
ceph) ceph)
__package librados-dev # dependency of ceph_exporter
require="$require __golang_from_vendor __package/librados-dev" __go_get github.com/digitalocean/ceph_exporter
port=9128 port=9128
run="setuidgid ceph $GOBIN/ceph_exporter -ceph.config /etc/ceph/ceph.conf -telemetry.addr :$port" run="setuidgid ceph $GOBIN/ceph_exporter -ceph.config /etc/ceph/ceph.conf -telemetry.addr :$port"
__package librados-dev # dependency of ceph_exporter
require="__golang_from_vendor __package/librados-dev" __go_get github.com/digitalocean/ceph_exporter
;; ;;
*) *)
echo "Unknown exporter: $exporter." >&2 echo "Unsupported exporter: $exporter." >&2
exit 1 exit 1
;; ;;
esac esac
require="__daemontools" __daemontools_service ${exporter}-exporter --run "$run" require="$require __daemontools" __daemontools_service ${exporter}-exporter --run "$run"
if [ -f "$__object/parameter/add-consul-service" ]; then if [ -f "$__object/parameter/add-consul-service" ]; then
__consul_service ${exporter}-exporter --port $port --check-http "http://localhost:$port/metrics" --check-interval 10s __consul_service ${exporter}-exporter --port $port --check-http "http://localhost:$port/metrics" --check-interval 10s
fi fi
#__daemontools --install-init-script #__daemontools --install-init-script
__daemontools __daemontools
__golang_from_vendor --version 1.8.1 # required for many exporters __golang_from_vendor --version 1.9 # required for many exporters