diff --git a/server/docker/grafana.yaml b/server/docker/grafana.yaml index 4e4ce52..6f50398 100644 --- a/server/docker/grafana.yaml +++ b/server/docker/grafana.yaml @@ -33,6 +33,35 @@ services: limits: cpus: '0.5' + node-exporter: + image: quay.io/prometheus/node-exporter:latest + container_name: node_exporter + command: + - '--path.rootfs=/host' + network_mode: host + pid: host + restart: unless-stopped + volumes: + - '/:/host:ro,rslave' + deploy: + resources: + limits: + cpus: '0.5' + + process-exporter: + ports: + - "9256:9256" + privileged: true + volumes: + - /proc:/host/proc + - "./config:/config" + image: ncabatoff/process-exporter + command: --procfs /host/proc -config.path /config/process-exporter.yaml + deploy: + resources: + limits: + cpus: '0.5' + prometheus: image: prom/prometheus:v2.24.0 ports: diff --git a/server/scripts/launch-all.sh b/server/scripts/launch-all.sh index 0907514..495a684 100755 --- a/server/scripts/launch-all.sh +++ b/server/scripts/launch-all.sh @@ -14,9 +14,6 @@ printf "$START* Running at $(date)$RESET\n" GRAFANA_COMPOSE_OVERRIDE=${GRAFANA_COMPOSE_OVERRIDE:-base} -echo -server/scripts/run-exporters.sh - # Start Grafana stack printf "${SECTION}* Launching Grafana stack...$RESET\n\n" diff --git a/server/scripts/run-exporters.sh b/server/scripts/run-exporters.sh deleted file mode 100755 index 58a0193..0000000 --- a/server/scripts/run-exporters.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -SECTION=$(tput setaf 5) -WARNING=$(tput setaf 3) -RESET=$(tput sgr0) - -LOG_DIRECTORY="/var/log/rusty-controller/prometheus-exporters" -mkdir -p "$LOG_DIRECTORY" - -if ! (which node_exporter > /dev/null || which process-exporter > /dev/null); then - echo "${WARNING}No exporters found. $RESET" - exit 0 -fi - -printf "${SECTION}* Launching Prometheus exporters...$RESET\n" - -tmux kill-session -t "Prometheus Exporters" 2>/dev/null && echo "Killed existing Prometheus Exporters tmux session" - -tmux new-session -d -s "Prometheus Exporters" - -tmux new-window -t "Prometheus Exporters" -n "node_exporter" -c "$(pwd)" "node_exporter 2>&1 | tee $LOG_DIRECTORY/node_exporter.log" -echo "Started new tmux session for node_exporter" - -tmux new-window -t "Prometheus Exporters" -n "process-exporter" -c "$(pwd)" "process-exporter 2>&1 | tee $LOG_DIRECTORY/process-exporter.log" -echo "Started new tmux session for process-exporter"