1 # DO NOT EDIT - This file is being maintained by Chef
5 evaluation_interval: 15s
9 - path_prefix: /alertmanager
15 - /etc/prometheus/*_rules.yml
18 - job_name: prometheus
21 metrics_path: /prometheus/metrics
25 - job_name: alertmanager
26 metrics_path: /alertmanager/metrics
34 <% @certificates.values.sort_by { |c| c[:domains].first }.each do |certificate| -%>
36 <% certificate[:nodes].sort_by { |h| h[:name] }.each do |host| -%>
37 - <%= certificate[:domains].first %>/<%= host[:name] %>:443
40 domain: <%= certificate[:domains].first %>
43 - source_labels: [__address__]
45 target_label: __param_module
46 - source_labels: [__address__]
48 target_label: __param_target
49 - source_labels: [__param_target]
51 target_label: instance
52 - target_label: __address__
53 replacement: 127.0.0.1:9219
54 <% @jobs.sort.each do |name, targets| -%>
55 - job_name: <%= name %>
56 <% if targets.first[:scrape_interval] -%>
57 scrape_interval: <%= targets.first[:scrape_interval] %>
59 <% if targets.first[:scrape_timeout] -%>
60 scrape_timeout: <%= targets.first[:scrape_timeout] %>
62 <% if targets.first[:sni] -%>
64 server_name: <%= targets.first[:sni] %>
66 - target_label: __scheme__
70 <% targets.each do |target| -%>
72 - "<%= target[:address] %>"
74 instance: <%= target[:instance] %>
75 <% target[:labels].sort.each do |name, value| -%>
76 <%= name %>: <%= value %>
79 metric_relabel_configs:
80 <% targets.each do |target| -%>
81 <% target[:metric_relabel].each do |relabel| -%>
82 - source_labels: [instance,<%= relabel[:source_labels] %>]
83 regex: "<%= target[:instance] %>;<%= relabel[:regex] %>"
84 action: <%= relabel[:action] %>
93 <% @snmp_targets.sort_by { |t| t[:instance] }.each do |target| -%>
95 <% target[:modules].each do |module_name| -%>
96 - "<%= target[:target] %>/<%= module_name %>/<%= target[:address] %>"
99 instance: <%= target[:instance] %>
100 <% target[:labels].sort.each do |name, value| -%>
101 <%= name %>: <%= value %>
105 - source_labels: [__address__]
106 regex: "([^/]+)/[^/]+/.*"
107 target_label: __param_target
108 - source_labels: [__address__]
109 regex: "[^/]+/([^/]+)/.*"
110 target_label: __param_module
111 - source_labels: [__address__]
112 regex: "[^/]+/([^/]+)/.*"
114 - source_labels: [__address__]
115 regex: "[^/]+/[^/]+/(.*)"
116 target_label: __address__