Merge "Add NODE_EXPORTER_COLLECTOR_EXCLUDE var to exclude additional collectors"

This commit is contained in:
Zuul 2025-03-10 13:46:53 +00:00 committed by Gerrit Code Review
commit 2df3cb3263
2 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,13 @@ function init_node_exporter {
node_exporter_cmd+=" --no-collector.timex --no-collector.uname --no-collector.stat --no-collector.hwmon"
node_exporter_cmd+=" --no-collector.os --no-collector.selinux --no-collector.textfile --no-collector.powersupplyclass"
node_exporter_cmd+=" --no-collector.pressure --no-collector.rapl"
if [[ $NODE_EXPORTER_COLLECTOR_EXCLUDE != "" ]]; then
collector_list=$(echo $NODE_EXPORTER_COLLECTOR_EXCLUDE | tr "," "\n")
for COLLECTOR in ${collector_list[@]}
do
node_exporter_cmd+=" --no-collector.${COLLECTOR}"
done
fi
write_user_unit_file $NODE_EXPORTER_SYSTEMD_SERVICE "$node_exporter_cmd" "" "$STACK_USER"

View File

@ -11,3 +11,5 @@ PROMETHEUS_CONFIG_FILE=${PROMETHEUS_CONFIG_FILE:-${PROMETHEUS_DEVSTACK_DIR}/prom
## Variables related to node exporter
NODE_EXPORTER_VERSION=1.8.2
# List of "," excluded collector names
NODE_EXPORTER_COLLECTOR_EXCLUDE=${NODE_EXPORTER_COLLECTOR_EXCLUDE:-""}