diff --git a/ansible/files/prosody.cfg.lua b/ansible/files/prosody.cfg.lua index adea2db..55f73bf 100644 --- a/ansible/files/prosody.cfg.lua +++ b/ansible/files/prosody.cfg.lua @@ -109,6 +109,9 @@ modules_enabled = { "http_oauth2"; "http_admin_api"; "rest"; + + -- Monitoring & maintenance + "measure_process"; } registration_watchers = {} -- Disable by default @@ -160,6 +163,17 @@ authorization = "internal" storage = "internal" statistics = "internal" +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" group_default_name = ENV_SNIKKET_SITE_NAME or DOMAIN @@ -196,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: ]] diff --git a/ansible/snikket.yml b/ansible/snikket.yml index 785efb4..61fbca2 100644 --- a/ansible/snikket.yml +++ b/ansible/snikket.yml @@ -9,7 +9,7 @@ package: "prosody-trunk" build: "1436" prosody_modules: - revision: "8e58a1b78336" + revision: "cade5dac1003" tasks: - import_tasks: tasks/prosody.yml - import_tasks: tasks/supervisor.yml diff --git a/ansible/tasks/prosody.yml b/ansible/tasks/prosody.yml index 0b404ed..c513441 100644 --- a/ansible/tasks/prosody.yml +++ b/ansible/tasks/prosody.yml @@ -116,6 +116,8 @@ - mod_muc_defaults - mod_muc_local_only - mod_http_host_status_check + - mod_measure_process + - mod_prometheus - name: Enable wanted modules (snikket-modules) file: