diff --git a/docker-compose.tmpl.yml b/docker-compose.tmpl.yml index 27685a4..b585b73 100644 --- a/docker-compose.tmpl.yml +++ b/docker-compose.tmpl.yml @@ -394,12 +394,17 @@ 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:-false}" 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: vol-freeswitch: diff --git a/sample.env b/sample.env index 3ff5f93..f9c6596 100644 --- a/sample.env +++ b/sample.env @@ -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 diff --git a/scripts/generate-compose b/scripts/generate-compose index 775412c..bd7d710 100755 --- a/scripts/generate-compose +++ b/scripts/generate-compose @@ -45,6 +45,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 \ diff --git a/scripts/setup b/scripts/setup index c5e334c..7a3ad6b 100755 --- a/scripts/setup +++ b/scripts/setup @@ -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,23 @@ 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 + if [ "$recording" == "y" ] then @@ -166,7 +174,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