]> git.openstreetmap.org Git - chef.git/commitdiff
Add domain labels to SSL exporter metrics
authorTom Hughes <tom@compton.nu>
Thu, 11 Feb 2021 19:21:32 +0000 (19:21 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 11 Feb 2021 19:21:32 +0000 (19:21 +0000)
cookbooks/prometheus/templates/default/prometheus.yml.erb

index 6e28106cb8bd35966e7ef181545a9dd1c780e270..01eb1fd4f38fbaad5f37f75688b905d9e00d8685 100644 (file)
@@ -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__]