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

@ -388,11 +388,16 @@ services:
environment:
API_BASE_URL: http://10.7.7.1:8080/bigbluebutton/api/
API_SECRET: ${SHARED_SECRET}
RECORDINGS_METRICS_READ_FROM_DISK: "false"
RECORDINGS_METRICS_READ_FROM_DISK: "${ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION}"
networks:
bbb-net:
ipv4_address: 10.7.7.33
{{ if isTrue .Env.ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION }}
volumes:
- bigbluebutton:/var/bigbluebutton:ro
{{end}}
{{end}}
volumes:
bigbluebutton:

View File

@ -26,6 +26,7 @@ ENABLE_GREENLIGHT=true
# serves the bigbluebutton-exporter under following URL:
# https://yourdomain/bbb-exporter
#ENABLE_PROMETHEUS_EXPORTER=true
#ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION=true
# Recording
# IMPORTANT: this is currently a big privacy issues, because it will

View File

@ -43,6 +43,7 @@ docker run \
-e ENABLE_COTURN=${ENABLE_COTURN:-false} \
-e ENABLE_GREENLIGHT=${ENABLE_GREENLIGHT:-false} \
-e ENABLE_PROMETHEUS_EXPORTER=${ENABLE_PROMETHEUS_EXPORTER:-false} \
-e ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION=${ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION:-false} \
-e NUMBER_OF_BACKEND_NODEJS_PROCESSES=${NUMBER_OF_BACKEND_NODEJS_PROCESSES:-1} \
-e NUMBER_OF_FRONTEND_NODEJS_PROCESSES=${NUMBER_OF_FRONTEND_NODEJS_PROCESSES:-1} \
jwilder/dockerize -template /docker-compose.tmpl.yml \

View File

@ -50,11 +50,6 @@ then
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