X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/480d14d1f1967e4911302e485ebde397c12d8795..66e3060c83b235c3942eab6cb162a6888bad8757:/cookbooks/postgresql/recipes/default.rb diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index 6a05f34e4..b192080fb 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -155,10 +155,10 @@ clusters.each do |name, details| end ports = clusters.collect do |_, details| - "port=#{details[:port]}" + details[:port] end -template "/etc/prometheus/collectors/postgres_queries.yml" do +template "/etc/prometheus/exporters/postgres_queries.yml" do source "postgres_queries.yml.erb" owner "root" group "root" @@ -168,7 +168,9 @@ end prometheus_exporter "postgres" do port 9187 user "postgres" - options "--extend.query-path=/etc/prometheus/collectors/postgres_queries.yml" - environment "DATA_SOURCE_NAME" => "user=postgres host=/run/postgresql #{ports.join(',')}", + options "--extend.query-path=/etc/prometheus/exporters/postgres_queries.yml" + environment "DATA_SOURCE_URI" => "postgres@:#{ports.join(',:')}/postgres?host=/run/postgresql", + "PG_EXPORTER_AUTO_DISCOVER_DATABASES" => "true", "PG_EXPORTER_EXCLUDE_DATABASES" => "postgres,template0,template1" + subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]" end