From 998cffe33e0834b711ce19b8d909a43a2f476084 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Mar 25 2024 03:57:04 +0000 Subject: Configure Discourse monitoring Enable Discourse metrics endpoint and configure it as a target in Prometheus. Public access to forums.o.o/metrics is denied as it's not clear whether it caches or directly forwards to the Webrick based collection service. Signed-off-by: Georg Pfuetzenreuter --- diff --git a/pillar/cluster/atlas/services.sls b/pillar/cluster/atlas/services.sls index b79d118..e2e94b5 100644 --- a/pillar/cluster/atlas/services.sls +++ b/pillar/cluster/atlas/services.sls @@ -22,6 +22,7 @@ haproxy: - path_matrix_client path_beg /.well-known/matrix/client - path_matrix_federation path_beg /.well-known/matrix/server - path_meetings path_beg /meetings + - path_metrics path /metrics - path_openid path_beg -i /openid - path_openid path_beg -i /common/app/ - path_openid path_beg -i /openid-ldap @@ -127,6 +128,7 @@ haproxy: - matrix-federation if path_matrix_federation - security_txt if path_security - internal if path_grafana_login !internal_clients + - internal if host_forums path_metrics !internal_clients # path-specific rules - jekyll if host_monitor path_slash diff --git a/pillar/role/monitoring/master.sls b/pillar/role/monitoring/master.sls index fbf3ad5..a88ecc3 100644 --- a/pillar/role/monitoring/master.sls +++ b/pillar/role/monitoring/master.sls @@ -106,6 +106,13 @@ prometheus: physical: [] kvm: [] + discourse: + port: 9405 + roles: + - discourse + simple: true + targets: [] + elasticsearch: port: 9114 roles: diff --git a/salt/profile/discourse/init.sls b/salt/profile/discourse/init.sls index 6970014..3d9f04b 100644 --- a/salt/profile/discourse/init.sls +++ b/salt/profile/discourse/init.sls @@ -1,9 +1,10 @@ {%- from 'macros.jinja' import puma_service_dropin %} -discourse_pgks: +discourse_pkgs: pkg.installed: - pkgs: - discourse + - discourse-plugin-prometheus - ruby3.2-rubygem-discourse_mail_receiver - nginx-module-brotli @@ -65,3 +66,12 @@ discourse_sidekiq_service: service.running: - name: discourse-puma - enable: True + - require: + - pkg: discourse_pkgs + +discourse_prometheus_collector: + service.running: + - name: discourse-prometheus-collector + - enable: True + - require: + - pkg: discourse_pkgs