]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/db/recipes/master.rb
Use sql_exporter to monitor rails queue lengths
[chef.git] / cookbooks / db / recipes / master.rb
index 636cd60dc9507c8e5bc2d5cee672f0591fbc6b85..eafc7db133b70ffcfb98f86d284ad634f5123ee8 100644 (file)
@@ -140,6 +140,10 @@ PLANETDIFF_PERMISSIONS = {
   "ways" => :select
 }.freeze
 
+PROMETHEUS_PERMISSIONS = {
+  "delayed_jobs" => :select
+}.freeze
+
 %w[
   acls
   active_storage_attachments
@@ -205,6 +209,7 @@ PLANETDIFF_PERMISSIONS = {
                 "cgimap" => CGIMAP_PERMISSIONS[table],
                 "planetdump" => PLANETDUMP_PERMISSIONS[table],
                 "planetdiff" => PLANETDIFF_PERMISSIONS[table],
+                "prometheus" => PROMETHEUS_PERMISSIONS[table],
                 "backup" => [:select]
   end
 end
@@ -300,3 +305,10 @@ end
 service "yearly-reindex.timer" do
   action [:enable, :start]
 end
+
+template "/etc/prometheus/exporters/sql_rails.collector.yml" do
+  source "sql_rails.yml.erb"
+  owner "root"
+  group "root"
+  mode "0644"
+end