]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/recipes/server.rb
Configure prometheus alert manager
[chef.git] / cookbooks / prometheus / recipes / server.rb
index 571714c50047f2486b215aa9466dace98c322e4e..9acc28671a06359d3d825f2c7ac2529b3dfd8dc4 100644 (file)
@@ -32,7 +32,10 @@ prometheus_exporter "fastly" do
   environment "FASTLY_API_TOKEN" => tokens["fastly"]
 end
 
-package "prometheus"
+package %w[
+  prometheus
+  prometheus-alertmanager
+]
 
 promscale_version = "0.1.4"
 
@@ -179,6 +182,18 @@ service "prometheus" do
   subscribes :reload, "template[/etc/prometheus/prometheus.yml]"
 end
 
+template "/etc/prometheus/alertmanager.yml" do
+  source "alertmanager.yml.erb"
+  owner "root"
+  group "root"
+  mode "644"
+end
+
+service "prometheus-alertmanager" do
+  action [:enable, :start]
+  subscribes :reload, "template[/etc/prometheus/alertmanager.yml]"
+end
+
 package "grafana-enterprise"
 
 template "/etc/grafana/grafana.ini" do