X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/221416602c42f7743aa984b24211370b05ba0bae..5f87e80390086757b4dbbf810e4417225751d7f9:/cookbooks/postgresql/recipes/default.rb diff --git a/cookbooks/postgresql/recipes/default.rb b/cookbooks/postgresql/recipes/default.rb index 6a05f34e4..5dbc00c48 100644 --- a/cookbooks/postgresql/recipes/default.rb +++ b/cookbooks/postgresql/recipes/default.rb @@ -158,7 +158,11 @@ ports = clusters.collect do |_, details| "port=#{details[:port]}" end -template "/etc/prometheus/collectors/postgres_queries.yml" do +file "/etc/prometheus/collectors/postgres_queries.yml" do + action :delete +end + +template "/etc/prometheus/exporters/postgres_queries.yml" do source "postgres_queries.yml.erb" owner "root" group "root" @@ -168,7 +172,8 @@ end prometheus_exporter "postgres" do port 9187 user "postgres" - options "--extend.query-path=/etc/prometheus/collectors/postgres_queries.yml" + options "--extend.query-path=/etc/prometheus/exporters/postgres_queries.yml" environment "DATA_SOURCE_NAME" => "user=postgres host=/run/postgresql #{ports.join(',')}", "PG_EXPORTER_EXCLUDE_DATABASES" => "postgres,template0,template1" + subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]" end