diff --git a/config/config.go b/config/config.go index 792ef5c1b0..419c26a945 100644 --- a/config/config.go +++ b/config/config.go @@ -117,7 +117,7 @@ var ( DefaultAlertmanagerConfig = AlertmanagerConfig{ Scheme: "http", Timeout: model.Duration(10 * time.Second), - APIVersion: AlertmanagerAPIVersionV1, + APIVersion: AlertmanagerAPIVersionV2, HTTPClientConfig: config.DefaultHTTPClientConfig, } diff --git a/config/config_test.go b/config/config_test.go index 61ef13ac86..b2ae0343f1 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -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{ diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index 3173279a29..2684eadadd 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -1755,7 +1755,7 @@ through the `__alerts_path__` label. [ timeout: | default = 10s ] # The api version of Alertmanager. -[ api_version: | default = v1 ] +[ api_version: | default = v2 ] # Prefix for the HTTP path alerts are pushed to. [ path_prefix: | default = / ] diff --git a/notifier/notifier_test.go b/notifier/notifier_test.go index 432e07f86b..ea0b7b1519 100644 --- a/notifier/notifier_test.go +++ b/notifier/notifier_test.go @@ -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", }, }