Enable optimization for Prometheus when recording is enabled

This commit is contained in:
omidmaldar
2021-10-17 01:01:07 +03:00
parent 40db868ccd
commit abeac58d73
4 changed files with 42 additions and 20 deletions

View File

@ -43,18 +43,13 @@ then
echo " you must provide a relative or absolute path"
echo " to your certificates."
while [[ -z "$CERTPATH" ]]; do
read -p "Please enter path to cert.pem: " CERTPATH
read -p "Please enter path to cert.pem: " CERTPATH
done
while [[ -z "$KEYPATH" ]]; do
read -p "Please enter path to key.pem: " KEYPATH
read -p "Please enter path to key.pem: " KEYPATH
done
fi
prometheus_exporter=""
while [[ ! $prometheus_exporter =~ ^(y|n)$ ]]; do
read -p "Should a Prometheus exporter be included? (y/n): " prometheus_exporter
done
DOMAIN=""
while [[ -z "$DOMAIN" ]]; do
read -p "Please enter the domain name: " DOMAIN
@ -68,10 +63,25 @@ echo " suggests, that it does not."
echo " make sure that you always get people's consent, before they join a room!"
echo " https://github.com/bigbluebutton/bigbluebutton/issues/9202"
while [[ ! $recording =~ ^(y|n)$ ]]; do
read -p "Choice (y/n): " recording
done
prometheus_exporter=""
while [[ ! $prometheus_exporter =~ ^(y|n)$ ]]; do
read -p "Should a Prometheus exporter be included? (y/n): " prometheus_exporter
done
if [ "$prometheus_exporter" == "y" ] && [ "$recording" == "y" ]
then
echo "Should Prometheus exporter optimization be enabled?"
echo " This instructs exporter to collect expensive recordings metrics by querying the disk instead of the API."
echo " Enabling this can substantially decrease the scrape time required for the exporter to respond to metrics requests"
prometheus_exporter_optimization=""
while [[ ! $prometheus_exporter_optimization =~ ^(y|n)$ ]]; do
read -p "Choice (y/n): " prometheus_exporter_optimization
done
fi
ip_correct=""
while [[ ! $ip_correct =~ ^(y|n)$ ]]; do
read -p "Is $EXTERNAL_IPv4 your external IPv4 address? (y/n): " ip_correct
@ -142,7 +152,12 @@ fi
if [ "$prometheus_exporter" == "y" ]
then
sed -i "s/#ENABLE_PROMETHEUS_EXPORTER.*/ENABLE_PROMETHEUS_EXPORTER=true/" .env
sed -i "s/#ENABLE_PROMETHEUS_EXPORTER=.*/ENABLE_PROMETHEUS_EXPORTER=true/" .env
fi
if [ "$prometheus_exporter_optimization" == "y" ]
then
sed -i "s/#ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION=.*/ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION=true/" .env
fi
# change secrets