]> git.openstreetmap.org Git - chef.git/blob - cookbooks/prometheus/templates/default/prometheus.yml.erb
Add backup script for prometheus
[chef.git] / cookbooks / prometheus / templates / default / prometheus.yml.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 global:
4   scrape_interval: 15s
5   evaluation_interval: 15s
6
7 alerting:
8   alertmanagers:
9     - path_prefix: /alertmanager
10       static_configs:
11         - targets:
12             - localhost:9093
13
14 rule_files:
15   - /etc/prometheus/*_rules.yml
16
17 scrape_configs:
18   - job_name: prometheus
19     scrape_interval: 5s
20     scrape_timeout: 5s
21     metrics_path: /prometheus/metrics
22     static_configs:
23       - targets:
24           - localhost:9090
25   - job_name: alertmanager
26     metrics_path: /alertmanager/metrics
27     static_configs:
28       - targets:
29           - localhost:9093
30 <% @jobs.sort.each do |name, targets| -%>
31   - job_name: <%= name %>
32     static_configs:
33 <% targets.each do |target| -%>
34       - targets:
35           - "<%= target[:address] %>"
36         labels:
37           instance: <%= target[:instance] %>
38 <% end -%>
39     metric_relabel_configs:
40 <% targets.each do |target| -%>
41 <% target[:metric_relabel].each do |relabel| -%>
42       - source_labels: [instance,<%= relabel[:source_labels] %>]
43         regex: "<%= target[:instance] %>;<%= relabel[:regex] %>"
44         action: <%= relabel[:action] %>
45 <% end -%>
46 <% end -%>
47 <% end -%>
48
49 # remote_write:
50 #   - url: "http://localhost:9201/write"