From: Tom Hughes Date: Thu, 17 Sep 2020 17:52:10 +0000 (+0000) Subject: Install prometheus apache exporter on machines running apache X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/2f921f3394c98b5168666d68449d67e337c90993 Install prometheus apache exporter on machines running apache --- diff --git a/cookbooks/apache/metadata.rb b/cookbooks/apache/metadata.rb index 06b231a1c..f6176ee8b 100644 --- a/cookbooks/apache/metadata.rb +++ b/cookbooks/apache/metadata.rb @@ -7,4 +7,5 @@ description "Installs and configures apache" version "1.0.0" supports "ubuntu" depends "munin" +depends "prometheus" depends "ssl" diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index 5ab1b21ee..f25806fcf 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -18,6 +18,7 @@ # include_recipe "munin" +include_recipe "prometheus" include_recipe "ssl" package %w[ @@ -94,3 +95,8 @@ end munin_plugin "apache_accesses" munin_plugin "apache_processes" munin_plugin "apache_volume" + +prometheus_exporter "apache" do + port 9117 + listen_switch "telemetry.address" +end diff --git a/cookbooks/prometheus/resources/exporter.rb b/cookbooks/prometheus/resources/exporter.rb index 08c0e03b7..e740ac79e 100644 --- a/cookbooks/prometheus/resources/exporter.rb +++ b/cookbooks/prometheus/resources/exporter.rb @@ -33,6 +33,7 @@ action :create do end template defaults_name do + cookbook "prometheus" source "defaults.erb" owner "root" group "root"