From 52bdaaaa5ce96a1144bdadb4d912e9b1f66bc1a5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 18 Nov 2020 17:16:44 +0000 Subject: [PATCH] Allow multiple instances of exporters --- cookbooks/prometheus/recipes/server.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cookbooks/prometheus/recipes/server.rb b/cookbooks/prometheus/recipes/server.rb index 6a1219ca0..8da6fd263 100644 --- a/cookbooks/prometheus/recipes/server.rb +++ b/cookbooks/prometheus/recipes/server.rb @@ -44,9 +44,12 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client } end - client[:prometheus][:exporters].each do |name, address| + client[:prometheus][:exporters].each do |name, addresses| jobs[name] ||= [] - jobs[name] << { :address => address, :name => client.name } + + Array(addresses).each do |address| + jobs[name] << { :address => address, :name => client.name } + end end end -- 2.39.5