From 974c017558b7b141af3cd6100eec9c74037b90fd Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 6 Feb 2024 11:37:59 +0200 Subject: [PATCH] Fix auto-exposure of Promtail metrics (mash_playbook_metrics_exposure_*) regardless of promtail_hostname being set --- templates/group_vars_mash_servers | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index cfa171a..c428312 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -4014,12 +4014,6 @@ promtail_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base promtail_uid: "{{ mash_playbook_uid }}" promtail_gid: "{{ mash_playbook_gid }}" -# Only enable Traefik labels if a hostname is set (indicating that this will be exposed publicly) -promtail_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled and promtail_hostname | length > 0 }}" -promtail_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" -promtail_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" -promtail_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" - # role-specific:loki promtail_config_clients_auto: | {{ @@ -4030,6 +4024,12 @@ promtail_config_clients_auto: | }} # /role-specific:loki +# Only enable Traefik labels if a hostname is set (indicating that this will be exposed publicly) +promtail_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +promtail_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +promtail_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +promtail_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + promtail_container_labels_metrics_enabled: "{{ prometheus_enabled | default(false) or mash_playbook_metrics_exposure_enabled }}" promtail_container_labels_metrics_hostname: "{{ mash_playbook_metrics_exposure_hostname }}" promtail_container_labels_metrics_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ promtail_identifier }}"