diff --git a/docs/services/prometheus-postgres-exporter.md b/docs/services/prometheus-postgres-exporter.md index e625530..ae1d8f9 100644 --- a/docs/services/prometheus-postgres-exporter.md +++ b/docs/services/prometheus-postgres-exporter.md @@ -18,12 +18,12 @@ prometheus_postgres_exporter_enabled: true # To expose the metrics publicly, enable and configure the lines below: # prometheus_postgres_exporter_hostname: mash.example.com -# prometheus_postgres_exporter_path_prefix: /metrics/postgres-exporter +# prometheus_postgres_exporter_path_prefix: /metrics/mash-prometheus-postgres-exporter -# To protect the metrics with HTTP Basic Auth, enable and configure the lines below: -# prometheus_postgres_exporter_basicauth_enabled: true -# prometheus_postgres_exporter_basicauth_user: your_username -# prometheus_postgres_exporter_basicauth_password: your password +# 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_postgres_exporter_container_labels_metrics_middleware_basic_auth_enabled: true +# prometheus_postgres_exporter_container_labels_metrics_middleware_basic_auth_users: '' ######################################################################## # # @@ -36,5 +36,5 @@ Unless you're scraping the Postgres Exporter metrics from a local [Prometheus](p ## Usage -After you installed the exporter, your stats will be available on `mash.example.com/metrics/postgres-exporter` with basic auth credentials you configured +After you installed the exporter, your stats will be available on `mash.example.com/metrics/mash-prometheus-postgres-exporter` with basic auth credentials you configured diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index 2dfd2c8..e78c62b 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -3732,15 +3732,13 @@ prometheus_postgres_exporter_enabled: false prometheus_postgres_exporter_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-postgres-exporter" +prometheus_postgres_exporter_path_prefix: "{{ mash_playbook_metrics_exposure_path_prefix }}/{{ prometheus_postgres_exporter_identifier }}" + prometheus_postgres_exporter_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}prometheus-postgres-exporter" prometheus_postgres_exporter_uid: "{{ mash_playbook_uid }}" prometheus_postgres_exporter_gid: "{{ mash_playbook_gid }}" -prometheus_postgres_exporter_basicauth_enabled: "{{ prometheus_postgres_exporter_container_labels_traefik_enabled }}" -prometheus_postgres_exporter_basicauth_user: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'prometheus-postgres-exporter.user', rounds=655555) | to_uuid }}" -prometheus_postgres_exporter_basicauth_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'prometheus-postgres-exporter.password', rounds=655555) | to_uuid }}" - prometheus_postgres_exporter_container_additional_networks: | {{ ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) @@ -3754,6 +3752,9 @@ prometheus_postgres_exporter_container_labels_traefik_docker_network: "{{ mash_p prometheus_postgres_exporter_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" prometheus_postgres_exporter_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" +prometheus_postgres_exporter_container_labels_metrics_middleware_basic_auth_enabled: "{{ mash_playbook_metrics_exposure_http_basic_auth_enabled }}" +prometheus_postgres_exporter_container_labels_metrics_middleware_basic_auth_users: "{{ mash_playbook_metrics_exposure_http_basic_auth_users }}" + prometheus_postgres_exporter_database_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}" prometheus_postgres_exporter_database_username: prometheus_postgres_exporter prometheus_postgres_exporter_database_password: "{{ devture_postgres_connection_password if devture_postgres_enabled else '' }}" diff --git a/templates/requirements.yml b/templates/requirements.yml index 856742e..603be67 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -249,7 +249,7 @@ name: prometheus_node_exporter activation_prefix: prometheus_node_exporter_ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git - version: v0.14.0-3 + version: v0.14.0-4 name: prometheus_postgres_exporter activation_prefix: prometheus_postgres_exporter_ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-ssh-exporter.git