]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/recipes/server.rb
Bump kitchen-dokken from 2.11.1 to 2.11.2
[chef.git] / cookbooks / prometheus / recipes / server.rb
index e10e9e4ceef1eb18ecf08c61f3009dfeda0e4a85..f3ff4d9ca636be1e597cca271a62f87bb35d3d0a 100644 (file)
@@ -22,6 +22,14 @@ include_recipe "apt"
 include_recipe "networking"
 
 passwords = data_bag_item("prometheus", "passwords")
+tokens = data_bag_item("prometheus", "tokens")
+
+prometheus_exporter "fastly" do
+  port 8080
+  listen_switch "endpoint"
+  listen_type "url"
+  environment "FASTLY_API_TOKEN" => tokens["fastly"]
+end
 
 package "prometheus"
 
@@ -36,7 +44,15 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client
     }
   end
 
-  client[:prometheus][:exporters].each do |name, address|
+  client[:prometheus][:exporters].each do |key, exporter|
+    if exporter.is_a?(Hash)
+      name = exporter[:name]
+      address = exporter[:address]
+    else
+      name = key
+      address = exporter
+    end
+
     jobs[name] ||= []
     jobs[name] << { :address => address, :name => client.name }
   end