Hook matrix-homeserver-proxy to matrix-prometheus-nginxlog-exporter

This commit is contained in:
Slavi Pantaleev 2024-01-13 16:51:09 +02:00
parent 262caf0d59
commit e2157517af
3 changed files with 12 additions and 5 deletions

View File

@ -3477,13 +3477,15 @@ matrix_nginx_proxy_access_log_syslog_integration_server_port: "{{ (matrix_promet
matrix_homeserver_proxy_enabled: true
matrix_homeserver_proxy_access_log_syslog_integration_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}"
matrix_homeserver_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_container_hostname | string + ':' + matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}"
matrix_homeserver_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_identifier | string +':'+ matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}"
matrix_homeserver_proxy_container_additional_networks: |
{{
(
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [])
+
([matrix_prometheus_nginxlog_exporter_container_network] if (matrix_prometheus_nginxlog_exporter_enabled and matrix_prometheus_nginxlog_exporter_container_network != matrix_homeserver_proxy_container_network) else [])
+
([
{
'synapse': matrix_synapse_container_network,
@ -3526,9 +3528,6 @@ matrix_homeserver_proxy_systemd_wanted_services_list_auto: |
([(matrix_media_repo_identifier + '.service')] if matrix_media_repo_enabled else [])
}}
# matrix_nginx_proxy_access_log_syslog_integration_enabled: "{{ matrix_prometheus_nginxlog_exporter_enabled }}"
# matrix_nginx_proxy_access_log_syslog_integration_server_port: "{{ (matrix_prometheus_nginxlog_exporter_container_hostname | string +':'+ matrix_prometheus_nginxlog_exporter_container_syslog_port | string) | default('') }}"
######################################################################
# #
# /matrix-homeserver-proxy #
@ -4332,6 +4331,8 @@ matrix_synapse_reverse_proxy_companion_container_additional_networks: |
(
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_synapse_reverse_proxy_companion_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network else [])
+
([matrix_prometheus_nginxlog_exporter_container_network] if (matrix_prometheus_nginxlog_exporter_enabled and matrix_prometheus_nginxlog_exporter_container_network != matrix_synapse_reverse_proxy_companion_container_network) else [])
+
([] if matrix_homeserver_container_network in ['', matrix_synapse_reverse_proxy_companion_container_network] else [matrix_homeserver_container_network])
) | unique
}}

View File

@ -71,6 +71,12 @@ matrix_homeserver_proxy_container_federation_api_host_bind_port: ''
# Option to disable the access log
matrix_homeserver_proxy_access_log_enabled: true
# Controls whether to send access logs to a remote syslog-compatible server
matrix_homeserver_proxy_access_log_syslog_integration_enabled: false
matrix_homeserver_proxy_access_log_syslog_integration_server_port: ''
# This is intentionally different. The maximum allowed length is 32 characters and dashes are not allowed.
matrix_homeserver_proxy_access_log_syslog_integration_tag: matrix_homeserver_proxy
# The tmpfs at /tmp needs to be large enough to handle multiple concurrent file uploads.
matrix_homeserver_proxy_tmp_directory_size_mb: "{{ (matrix_homeserver_proxy_federation_api_client_max_body_size_mb | int) * 50 }}"
matrix_homeserver_proxy_tmp_cache_directory_size_mb: "{{ (matrix_homeserver_proxy_cache_max_size_mb | int) * 2 }}"

View File

@ -47,7 +47,7 @@ http {
'$status "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log syslog:server={{ matrix_homeserver_proxy_access_log_syslog_integration_server_port }},tag=matrix_nginx_proxy_companion prometheus_fmt;
access_log syslog:server={{ matrix_homeserver_proxy_access_log_syslog_integration_server_port }},tag={{ matrix_homeserver_proxy_access_log_syslog_integration_tag }} prometheus_fmt;
{% endif %}
{% if not matrix_homeserver_proxy_access_log_enabled and not matrix_homeserver_proxy_access_log_syslog_integration_enabled %}