]> git.openstreetmap.org Git - chef.git/commitdiff
Restart prometheus services when the binaries change
authorTom Hughes <tom@compton.nu>
Sun, 21 Nov 2021 10:03:09 +0000 (10:03 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 21 Nov 2021 10:03:09 +0000 (10:03 +0000)
cookbooks/prometheus/recipes/server.rb

index 2e3ab53ade82e05141d0145f53a79b0bda709e61..f0c4a8821ba1a2beabe470de5508aa19e49315c5 100644 (file)
@@ -301,6 +301,7 @@ service "prometheus" do
   action [:enable, :start]
   subscribes :reload, "template[/etc/prometheus/prometheus.yml]"
   subscribes :reload, "template[/etc/prometheus/alert_rules.yml]"
+  subscribes :restart, "archive_file[#{cache_dir}/prometheus.linux-amd64.tar.gz]"
 end
 
 systemd_service "prometheus-alertmanager-executable" do
@@ -320,6 +321,7 @@ end
 service "prometheus-alertmanager" do
   action [:enable, :start]
   subscribes :reload, "template[/etc/prometheus/alertmanager.yml]"
+  subscribes :restart, "archive_file[#{cache_dir}/alertmanager.linux-amd64.tar.gz]"
 end
 
 template "/etc/prometheus/amtool.yml" do
@@ -351,6 +353,7 @@ end
 service "prometheus-karma" do
   action [:enable, :start]
   subscribes :reload, "template[/etc/prometheus/karma.yml]"
+  subscribes :restart, "archive_file[#{cache_dir}/karma-linux-amd64.tar.gz]"
 end
 
 package "grafana-enterprise"