From be386c1df0de49e95aaf235927d5f0cc2d7a9bb0 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 23 Nov 2021 18:29:34 +0000 Subject: [PATCH 1/1] Add prometheus exporter for nominatim --- cookbooks/nominatim/metadata.rb | 1 + cookbooks/nominatim/recipes/default.rb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/cookbooks/nominatim/metadata.rb b/cookbooks/nominatim/metadata.rb index de51c87ca..3c8903ef3 100644 --- a/cookbooks/nominatim/metadata.rb +++ b/cookbooks/nominatim/metadata.rb @@ -13,5 +13,6 @@ depends "munin" depends "nginx" depends "php" depends "postgresql" +depends "prometheus" depends "python" depends "systemd" diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 7a9e9f163..2285cee73 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -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"] @@ -455,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" -- 2.39.5