Allow to load the prometheus exposition module based on env vars

Useful for monitoring.
This commit is contained in:
Jonas Schäfer 2021-05-27 18:04:35 +02:00
parent 690f58bb27
commit ff977f55b5
2 changed files with 18 additions and 1 deletions

View File

@ -162,7 +162,17 @@ authentication = "internal_hashed"
authorization = "internal"
storage = "internal"
statistics = "internal"
statistics_interval = 60
if ENV_SNIKKET_TWEAK_PROMETHEUS == "1" then
-- When using Prometheus, it is desirable to let the prometheus scraping
-- drive the sampling of metrics
statistics_interval = "manual"
else
-- When not using Prometheus, we need an interval so that the metrics can
-- be shown by the web portal. The HTTP admin API exposure does not force
-- a collection as it is only interested in very few specific metrics.
statistics_interval = 60
end
certificates = "certs"
@ -200,6 +210,12 @@ VirtualHost (DOMAIN)
invites_register = "/register";
}
if ENV_SNIKKET_TWEAK_PROMETHEUS == "1" then
modules_enabled = {
"prometheus";
}
end
welcome_message = [[Hi, welcome to Snikket on $host! Thanks for joining us.]]
.."\n\n"
..[[For help and enquiries related to this service you may contact the admin via email: ]]

View File

@ -117,6 +117,7 @@
- mod_muc_local_only
- mod_http_host_status_check
- mod_measure_process
- mod_prometheus
- name: Enable wanted modules (snikket-modules)
file: