Switch to alertmanager api v2

According to the 2.25 release notes, 2.26 should switch to alertmanager
api v2 by default.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2021-03-19 18:19:12 +01:00
parent 195611e232
commit 49016994ac
4 changed files with 5 additions and 5 deletions

View file

@ -117,7 +117,7 @@ var (
DefaultAlertmanagerConfig = AlertmanagerConfig{
Scheme: "http",
Timeout: model.Duration(10 * time.Second),
APIVersion: AlertmanagerAPIVersionV1,
APIVersion: AlertmanagerAPIVersionV2,
HTTPClientConfig: config.DefaultHTTPClientConfig,
}

View file

@ -785,7 +785,7 @@ var expectedConf = &Config{
{
Scheme: "https",
Timeout: model.Duration(10 * time.Second),
APIVersion: AlertmanagerAPIVersionV1,
APIVersion: AlertmanagerAPIVersionV2,
HTTPClientConfig: config.DefaultHTTPClientConfig,
ServiceDiscoveryConfigs: discovery.Configs{
discovery.StaticConfig{

View file

@ -1755,7 +1755,7 @@ through the `__alerts_path__` label.
[ timeout: <duration> | default = 10s ]
# The api version of Alertmanager.
[ api_version: <string> | default = v1 ]
[ api_version: <string> | default = v2 ]
# Prefix for the HTTP path alerts are pushed to.
[ path_prefix: <path> | default = / ]

View file

@ -454,7 +454,7 @@ func TestReload(t *testing.T) {
},
},
},
out: "http://alertmanager:9093/api/v1/alerts",
out: "http://alertmanager:9093/api/v2/alerts",
},
}
@ -504,7 +504,7 @@ func TestDroppedAlertmanagers(t *testing.T) {
},
},
},
out: "http://alertmanager:9093/api/v1/alerts",
out: "http://alertmanager:9093/api/v2/alerts",
},
}