]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/default.rb
Add prometheus exporter for nominatim
[chef.git] / cookbooks / nominatim / recipes / default.rb
index 36389d896380a5638fee9e442ec59720bd3c2b3d..2285cee73c42e3d79c56f13114aa54f1d689cd65 100644 (file)
@@ -20,6 +20,7 @@
 include_recipe "accounts"
 include_recipe "munin"
 include_recipe "php::fpm"
+include_recipe "prometheus"
 
 basedir = data_bag_item("accounts", "nominatim")["home"]
 email_errors = data_bag_item("accounts", "lonvia")["email"]
@@ -330,7 +331,11 @@ else
   systemd_timer "nominatim-update-maintenance-trigger" do
     action :create
     description "Schedule maintenance tasks for Nominatim DB"
-    on_calender "*-*-* 02:03:00 UTC"
+    on_calendar "*-*-* 02:03:00 UTC"
+  end
+
+  service "nominatim-update-maintenance-trigger" do
+    action [:enable]
   end
 end
 
@@ -451,6 +456,15 @@ munin_plugin "nominatim_requests" do
   target "#{source_directory}/munin/nominatim_requests_querylog"
 end
 
+prometheus_exporter "nominatim" do
+  port 8082
+  user "www-data"
+  options [
+    "--nominatim.query-log=#{node[:nominatim][:logdir]}/query.log",
+    "--nominatim.database-name=#{node[:nominatim][:dbname]}"
+  ]
+end
+
 directory "#{basedir}/status" do
   owner "nominatim"
   group "postgres"