Commit 1b372f20 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧 Committed by Sven-Hendrik Haase

Remove host label for our metrics

All our node_exporter's have an instance label already which shows the
hostname of the machine. The instance label is also used in our
prometheus alerts making host obsolete.
parent 51a74eac
Pipeline #2207 passed with stage
in 40 seconds
......@@ -8,7 +8,6 @@ if (( $# != 1 )); then
exit 1
fi
HOSTNAME=$(hostname)
TEXTFILE_COLLECTOR_DIR=${1}
PROM_FILE=$TEXTFILE_COLLECTOR_DIR/pacman.prom
......@@ -22,10 +21,10 @@ secupdates=$(/usr/bin/arch-audit -u | wc -l)
echo "# HELP pacman_updates_pending number of pending updates from pacman" >> $TMP_FILE
echo "# TYPE pacman_updates_pending gauge" >> $TMP_FILE
echo "pacman_updates_pending{host=\"${HOSTNAME}\"} $updates" >> $TMP_FILE
echo "pacman_updates_pending $updates" >> $TMP_FILE
echo "# HELP pacman_security_updates_pending number of pending updates from pacman" >> $TMP_FILE
echo "# TYPE pacman_security_updates_pending gauge" >> $TMP_FILE
echo "pacman_security_updates_pending{host=\"${HOSTNAME}\"} $secupdates" >> $TMP_FILE
echo "pacman_security_updates_pending $secupdates" >> $TMP_FILE
mv -f $TMP_FILE $PROM_FILE
......@@ -9,7 +9,6 @@ if (( $# != 1 )); then
exit 1
fi
HOSTNAME=$(hostname)
TEXTFILE_COLLECTOR_DIR=${1}
PROM_FILE=$TEXTFILE_COLLECTOR_DIR/borg.prom
......@@ -28,7 +27,7 @@ if [[ -f /usr/local/bin/borg ]]; then
echo "# HELP borg_hetzner_last_archive_timestamp timestamp of last backup in UTC" >> $TMP_FILE
echo "# TYPE borg_hetzner_last_archive_timestamp counter" >> $TMP_FILE
echo "borg_hetzner_last_archive_timestamp{host=\"${HOSTNAME}\"} $LAST_ARCHIVE_TIMESTAMP" >> $TMP_FILE;
echo "borg_hetzner_last_archive_timestamp $LAST_ARCHIVE_TIMESTAMP" >> $TMP_FILE;
fi
# rsync.net borg
......@@ -40,7 +39,7 @@ if [[ -f /usr/local/bin/borg-offsite ]]; then
echo "# HELP borg_offsite_last_archive_timestamp timestamp of last backup in UTC" >> $TMP_FILE
echo "# TYPE borg_offsite_last_archive_timestamp counter" >> $TMP_FILE
echo "borg_offsite_last_archive_timestamp{host=\"${HOSTNAME}\"} $LAST_ARCHIVE_TIMESTAMP" >> $TMP_FILE;
echo "borg_offsite_last_archive_timestamp $LAST_ARCHIVE_TIMESTAMP" >> $TMP_FILE;
fi
mv -f $TMP_FILE $PROM_FILE
......@@ -8,7 +8,6 @@ if (( $# != 1 )); then
exit 1
fi
HOSTNAME=$(hostname)
TEXTFILE_COLLECTOR_DIR=${1}
PROM_FILE=$TEXTFILE_COLLECTOR_DIR/rebuilderd.prom
......@@ -22,10 +21,10 @@ workers=$(rebuildctl status | wc -l)
echo "# HELP rebuilderd_queue_length number of packages in rebuilderd queue" >> $TMP_FILE
echo "# TYPE rebuilderd_queue_length gauge" >> $TMP_FILE
echo "rebuilderd_queue_length{host=\"${HOSTNAME}\"} $queuelength" >> $TMP_FILE
echo "rebuilderd_queue_length $queuelength" >> $TMP_FILE
echo "# HELP rebuilderd_workers number of rebuilderd-workers available" >> $TMP_FILE
echo "# TYPE rebuilderd_workers gauge" >> $TMP_FILE
echo "rebuilderd_workers{host=\"${HOSTNAME}\"} $workers" >> $TMP_FILE
echo "rebuilderd_workers $workers" >> $TMP_FILE
mv -f $TMP_FILE $PROM_FILE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment