From d7c841bc3a243f26ced983d3bcfd1a7b66a922db Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 23 Jan 2024 18:05:23 +0200 Subject: [PATCH] Upgrade prometheus-blackbox-exporter (v0.24.0-1 -> v0.24.0-2) and integrate with mash_playbook_metrics_exposure_* --- docs/services/prometheus-blackbox-exporter.md | 14 ++++++++------ templates/group_vars_mash_servers | 9 +++++---- templates/requirements.yml | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/services/prometheus-blackbox-exporter.md b/docs/services/prometheus-blackbox-exporter.md index ffeaaa4..85d9dc0 100644 --- a/docs/services/prometheus-blackbox-exporter.md +++ b/docs/services/prometheus-blackbox-exporter.md @@ -15,12 +15,14 @@ To enable this service, add the following configuration to your `vars.yml` file prometheus_blackbox_exporter_enabled: true -# if you want to export blackbox's probe endpoint, uncomment and adjust the following vars - +# To expose the metrics publicly, enable and configure the lines below: # prometheus_blackbox_exporter_hostname: mash.example.com -# prometheus_blackbox_exporter_path_prefix: /metrics/blackbox-exporter -# prometheus_blackbox_exporter_basicauth_user: your_username -# prometheus_blackbox_exporter_basicauth_password: your password +# prometheus_blackbox_exporter_path_prefix: /metrics/mash-prometheus-blackbox-exporter + +# To protect the metrics with HTTP Basic Auth, enable and configure the lines below. +# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users +# prometheus_blackbox_exporter_container_labels_metrics_middleware_basic_auth_enabled: true +# prometheus_blackbox_exporter_container_labels_metrics_middleware_basic_auth_users: '' ######################################################################## # # @@ -31,4 +33,4 @@ prometheus_blackbox_exporter_enabled: true ## Usage -After you've installed the blackbox exporter, your blackbox prober will be available on `mash.example.com/metrics/blackbox-exporter` with the basic auth credentials you've configured if hostname and path prefix where provided +After you've installed the blackbox exporter, your blackbox prober will be available on `mash.example.com/metrics/mash-prometheus-blackbox-exporter` with the basic auth credentials you've configured if hostname and path prefix where provided diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index e78c62b..e2555f0 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -3825,15 +3825,13 @@ prometheus_blackbox_exporter_enabled: false prometheus_blackbox_exporter_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-blackbox-exporter" +prometheus_blackbox_exporter_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ prometheus_blackbox_exporter_identifier }}" + prometheus_blackbox_exporter_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}prometheus-blackbox-exporter" prometheus_blackbox_exporter_uid: "{{ mash_playbook_uid }}" prometheus_blackbox_exporter_gid: "{{ mash_playbook_gid }}" -prometheus_blackbox_exporter_basicauth_enabled: "{{ prometheus_blackbox_exporter_container_labels_traefik_enabled }}" -prometheus_blackbox_exporter_basicauth_user: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'blackbox.user', rounds=655555) | to_uuid }}" -prometheus_blackbox_exporter_basicauth_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'blackbox.password', rounds=655555) | to_uuid }}" - prometheus_blackbox_exporter_container_additional_networks: | {{ ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) @@ -3845,6 +3843,9 @@ prometheus_blackbox_exporter_container_labels_traefik_docker_network: "{{ mash_p prometheus_blackbox_exporter_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" prometheus_blackbox_exporter_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" +prometheus_blackbox_exporter_container_labels_metrics_middleware_basic_auth_enabled: "{{ mash_playbook_metrics_exposure_http_basic_auth_enabled }}" +prometheus_blackbox_exporter_container_labels_metrics_middleware_basic_auth_users: "{{ mash_playbook_metrics_exposure_http_basic_auth_users }}" + ######################################################################## # # # /prometheus_blackbox_exporter # diff --git a/templates/requirements.yml b/templates/requirements.yml index 603be67..833c9b9 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -241,7 +241,7 @@ name: prometheus activation_prefix: prometheus_enabled - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-blackbox-exporter.git - version: v0.24.0-1 + version: v0.24.0-2 name: prometheus_blackbox_exporter activation_prefix: prometheus_blackbox_exporter_ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-node-exporter.git