feat(backend): add support for custom headers (#368)

This will allow the AlertManager upstreams to be sent user defined HTTP headers.
This commit is contained in:
Richard Maynard
2019-01-17 02:53:33 -06:00
committed by Łukasz Mierzwa
parent c6f392ebd9
commit ec14be0288
13 changed files with 49 additions and 14 deletions

View File

@@ -41,6 +41,8 @@ alertmanager:
ca: string
cert: string
key: string
headers:
any: string
```
- `interval` - how often alerts should be refreshed, a string in
@@ -85,9 +87,12 @@ alertmanager:
TLS connections to this Alertmanager instance if it requires a TLS client
authentication.
Note that this option requires `tls:cert` to be also set.
- `headers` - a map with a list of key: values which are header: value.
These custom headers will be sent with every request to the alert manager
instance.
Example with two production Alertmanager instances running in HA mode and a
staging instance that is also proxied:
staging instance that is also proxied and requires a custom auth header:
```yaml
alertmanager:
@@ -107,6 +112,8 @@ alertmanager:
proxy: true
tls:
ca: /etc/ssl/staging-ca.crt
headers:
X-Auth-Token: aValidToken
- name: protected
uri: https://alertmanager-auth.prod.example.com
timeout: 20s

View File

@@ -5,6 +5,8 @@ alertmanager:
uri: http://localhost:9093
timeout: 10s
proxy: true
headers:
X-Auth-Test: some-token-or-other-string
- name: client-auth
uri: https://localhost:9093
timeout: 10s