template "ohai.rb.erb"
end
-file "/etc/prometheus/exporters/postgres_queries.yml" do
- action :delete
-end
-
package "pgtop"
package "libdbd-pg-perl"
labels "cluster" => name
scrape_interval "1m"
scrape_timeout "1m"
- user "postgres"
options %w[
--collector.database_wraparound
--collector.long_running_transactions
--collector.stat_wal_receiver
--collector.statio_user_indexes
]
- environment "DATA_SOURCE_NAME" => "postgres:///#{prometheus_database}?host=/run/postgresql&port=#{details[:port]}"
+ environment "DATA_SOURCE_NAME" => "postgres:///#{prometheus_database}?host=/run/postgresql&port=#{details[:port]}&user=prometheus&password=#{passwords['prometheus']}"
restrict_address_families "AF_UNIX"
- remove_ipc false
subscribes :restart, "template[/etc/prometheus/exporters/postgres_queries.yml]"
end
conf_variables :port => details[:port]
end
end
-
-service "prometheus-postgres-exporter" do
- action [:stop, :disable]
-end
-
-systemd_service "prometheus-postgres-exporter" do
- action :delete
-end