From 497f7692972b1d9e158e2945ab57de63d9dd3cdd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 11 Feb 2021 19:21:32 +0000 Subject: [PATCH] Add domain labels to SSL exporter metrics --- cookbooks/prometheus/templates/default/prometheus.yml.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cookbooks/prometheus/templates/default/prometheus.yml.erb b/cookbooks/prometheus/templates/default/prometheus.yml.erb index 6e28106cb..01eb1fd4f 100644 --- a/cookbooks/prometheus/templates/default/prometheus.yml.erb +++ b/cookbooks/prometheus/templates/default/prometheus.yml.erb @@ -31,11 +31,13 @@ scrape_configs: scrape_interval: 15m metrics_path: /probe static_configs: - - targets: <% @certificates.values.sort_by { |c| c[:domains].first }.each do |certificate| -%> + - targets: <% certificate[:nodes].sort_by { |h| h[:name] }.each do |host| -%> - <%= certificate[:domains].first %>/<%= host[:name] %>:443 <% end -%> + labels: + domain: <%= certificate[:domains].first %> <% end -%> relabel_configs: - source_labels: [__address__] -- 2.45.1