Fix auto-exposure of Promtail metrics (mash_playbook_metrics_exposure_*) regardless of promtail_hostname being set

This commit is contained in:
Slavi Pantaleev 2024-02-06 11:37:59 +02:00
parent d95d4e71a3
commit 974c017558

View file

@ -4014,12 +4014,6 @@ promtail_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base
promtail_uid: "{{ mash_playbook_uid }}" promtail_uid: "{{ mash_playbook_uid }}"
promtail_gid: "{{ mash_playbook_gid }}" 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 # role-specific:loki
promtail_config_clients_auto: | promtail_config_clients_auto: |
{{ {{
@ -4030,6 +4024,12 @@ promtail_config_clients_auto: |
}} }}
# /role-specific:loki # /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_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_hostname: "{{ mash_playbook_metrics_exposure_hostname }}"
promtail_container_labels_metrics_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ promtail_identifier }}" promtail_container_labels_metrics_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ promtail_identifier }}"