forked from cloudflare/pint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discovery.hcl
39 lines (34 loc) · 1.18 KB
/
discovery.hcl
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
# Example with Prometheus server discovery.
discovery {
# filepath discovery will generate Prometheus servers from files on disk.
# We define a regexp and any file or directory path matching that regexp will
# generate a new Prometheus server.
filepath {
# Directory to scan for files.
directory = "/etc/prometheus/servers"
# Regexp rule to match, with capture groups to store variables.
match = "(?P<name>\\w+).yaml"
# Use variables from the regex to generate a new Prometheus configuration block.
template {
name = "prometheus-{{ $name }}" # We can use 'name' regexp capture group as $name.
uri = "https://prometheus-{{ $name }}.example.com"
failover = [ "https://prometheus-{{ $name }}-backup.example.com" ]
headers = {
"X-Auth": "secret",
"X-User": "bob"
"X-Cluster": "{{ $name }}"
}
timeout = "30s"
}
template {
name = "prometheus-clone-{{ $name }}"
uri = "https://{{ $name }}.example.com"
failover = [ "https://{{ $name }}-backup.example.com" ]
headers = {
"X-Auth": "secret",
"X-User": "bob",
}
timeout = "30s"
}
}
}