-
Notifications
You must be signed in to change notification settings - Fork 261
/
postgres.yaml.erb
53 lines (52 loc) · 1.38 KB
/
postgres.yaml.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
init_config:
# empty by design
instances:
<% @instances.each do |i| -%>
- host: <%= i["server"] %>
port: <%= i["port"] || 5432 %>
username: <%= i["username"] %>
password: <%= i["password"] %>
<% if i.key?("tags") -%>
tags:
<% i["tags"].each do |t| -%>
- <%= t %>
<% end -%>
<% end -%>
<%- if i.key?('dbname') %>
dbname: <%= i['dbname'] %>
<% end -%>
<%- if i.key?('ssl') %>
ssl: <%= i['ssl'] %>
<% end -%>
<% if i.key?("relations") -%>
relations:
<% i["relations"].each do |r| -%>
- <%= r %>
<% end -%>
<% end -%>
<%- if i.key?("collect_function_metrics") %>
collect_function_metrics: <%= i["collect_function_metrics"] %>
<% end -%>
<% if i.key?('custom_metrics') -%>
custom_metrics:
<% i["custom_metrics"].each do |cm| -%>
- query: <%= cm["query"] %>
metrics:
<% cm["metrics"].each do |column, vals| -%>
<%= column %>:
<% Array(vals).each do |val| -%>
- <%= val %>
<% end -%>
<% end -%>
<% if cm.key?("descriptors") -%>
descriptors:
<% Array(cm["descriptors"]).each do |d| %>
- <%= d %>
<% end -%>
<% end -%>
<% if cm.key?("relation") -%>
relation: <%= cm["relation"] %>
<% end -%>
<% end -%>
<% end -%>
<% end -%>