From dbe3f71ee266226203056298d9705be69af31639 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 26 Jan 2023 13:24:10 +0000 Subject: [PATCH] Configure prometheus exporter for elasticsearch --- cookbooks/elasticsearch/metadata.rb | 1 + cookbooks/elasticsearch/recipes/default.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/cookbooks/elasticsearch/metadata.rb b/cookbooks/elasticsearch/metadata.rb index 37f38ee1a..e1301a39b 100644 --- a/cookbooks/elasticsearch/metadata.rb +++ b/cookbooks/elasticsearch/metadata.rb @@ -7,3 +7,4 @@ description "Installs and configures a elasticsearch server" version "1.0.0" supports "ubuntu" depends "apt" +depends "prometheus" diff --git a/cookbooks/elasticsearch/recipes/default.rb b/cookbooks/elasticsearch/recipes/default.rb index ce4083f79..a48ee9987 100644 --- a/cookbooks/elasticsearch/recipes/default.rb +++ b/cookbooks/elasticsearch/recipes/default.rb @@ -17,6 +17,8 @@ # limitations under the License. # +include_recipe "prometheus" + case node[:elasticsearch][:version] when "6.x" then include_recipe "apt::elasticsearch6" when "7.x" then include_recipe "apt::elasticsearch7" @@ -38,3 +40,7 @@ service "elasticsearch" do action [:enable, :start] supports :status => true, :restart => true end + +prometheus_exporter "elasticsearch" do + port 9114 +end -- 2.39.5