feat(config): add cluster option to alertmanager instances

This commit is contained in:
Łukasz Mierzwa
2020-06-11 19:28:19 +01:00
committed by Łukasz Mierzwa
parent ca25eb9fbe
commit e52cc91964
3 changed files with 5 additions and 1 deletions

View File

@@ -358,6 +358,7 @@ func (config *configSchema) LogValues() {
servers := []AlertmanagerConfig{}
for _, s := range cfg.Alertmanager.Servers {
server := AlertmanagerConfig{
Cluster: s.Cluster,
Name: s.Name,
URI: uri.SanitizeURI(s.URI),
ExternalURI: uri.SanitizeURI(s.ExternalURI),

View File

@@ -33,7 +33,8 @@ authorization:
alertmanager:
interval: 1s
servers:
- name: default
- cluster: ""
name: default
uri: http://localhost
external_uri: http://example.com
timeout: 40s

View File

@@ -10,6 +10,7 @@ type AlertmanagerCORS struct {
}
type AlertmanagerConfig struct {
Cluster string
Name string
URI string
ExternalURI string `yaml:"external_uri" koanf:"external_uri"`
@@ -70,6 +71,7 @@ type configSchema struct {
Alertmanager struct {
Interval time.Duration
Servers []AlertmanagerConfig
Cluster string `yaml:"-" koanf:"cluster"`
Name string `yaml:"-" koanf:"name"`
Timeout time.Duration `yaml:"-" koanf:"timeout"`
URI string `yaml:"-" koanf:"uri"`