Merge pull request #161 from omidmaldar-lms/prometheus-exporter-optimization

Enable optimization for Prometheus Exporter when recording is enabled
This commit is contained in:
chandi 2021-11-27 17:24:10 +01:00 committed by GitHub
commit 11bbe94985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 8 deletions

View File

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

View File

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

View File

@ -45,6 +45,7 @@ docker run \
-e ENABLE_COTURN=${ENABLE_COTURN:-false} \ -e ENABLE_COTURN=${ENABLE_COTURN:-false} \
-e ENABLE_GREENLIGHT=${ENABLE_GREENLIGHT:-false} \ -e ENABLE_GREENLIGHT=${ENABLE_GREENLIGHT:-false} \
-e ENABLE_PROMETHEUS_EXPORTER=${ENABLE_PROMETHEUS_EXPORTER:-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_BACKEND_NODEJS_PROCESSES=${NUMBER_OF_BACKEND_NODEJS_PROCESSES:-1} \
-e NUMBER_OF_FRONTEND_NODEJS_PROCESSES=${NUMBER_OF_FRONTEND_NODEJS_PROCESSES:-1} \ -e NUMBER_OF_FRONTEND_NODEJS_PROCESSES=${NUMBER_OF_FRONTEND_NODEJS_PROCESSES:-1} \
jwilder/dockerize -template /docker-compose.tmpl.yml \ jwilder/dockerize -template /docker-compose.tmpl.yml \

View File

@ -50,11 +50,6 @@ then
done done
fi fi
prometheus_exporter=""
while [[ ! $prometheus_exporter =~ ^(y|n)$ ]]; do
read -p "Should a Prometheus exporter be included? (y/n): " prometheus_exporter
done
DOMAIN="" DOMAIN=""
while [[ -z "$DOMAIN" ]]; do while [[ -z "$DOMAIN" ]]; do
read -p "Please enter the domain name: " DOMAIN read -p "Please enter the domain name: " DOMAIN
@ -68,10 +63,23 @@ echo " suggests, that it does not."
echo " make sure that you always get people's consent, before they join a room!" echo " make sure that you always get people's consent, before they join a room!"
echo " https://github.com/bigbluebutton/bigbluebutton/issues/9202" echo " https://github.com/bigbluebutton/bigbluebutton/issues/9202"
while [[ ! $recording =~ ^(y|n)$ ]]; do while [[ ! $recording =~ ^(y|n)$ ]]; do
read -p "Choice (y/n): " recording read -p "Choice (y/n): " recording
done 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
if [ "$recording" == "y" ] if [ "$recording" == "y" ]
then then
@ -166,7 +174,12 @@ fi
if [ "$prometheus_exporter" == "y" ] if [ "$prometheus_exporter" == "y" ]
then 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 fi
# change secrets # change secrets