Skip to content

Commit

Permalink
default to alertmanager v2 api
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Keeys <[email protected]>
  • Loading branch information
jakekeeys committed Feb 9, 2024
1 parent 94f971b commit 6da7c6d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Changed

- [#7123](https://github.com/thanos-io/thanos/pull/7123) Rule: Change default Alertmanager API version to v2.

### Removed

## [v0.34.0](https://github.com/thanos-io/thanos/tree/release-0.34) - 26.01.24
Expand Down
4 changes: 2 additions & 2 deletions pkg/alert/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func DefaultAlertmanagerConfig() AlertmanagerConfig {
FileSDConfigs: []clientconfig.HTTPFileSDConfig{},
},
Timeout: model.Duration(time.Second * 10),
APIVersion: APIv1,
APIVersion: APIv2,
}
}

Expand Down Expand Up @@ -136,7 +136,7 @@ func BuildAlertmanagerConfig(address string, timeout time.Duration) (Alertmanage
StaticAddresses: []string{host},
},
Timeout: model.Duration(timeout),
APIVersion: APIv1,
APIVersion: APIv2,
}, nil
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/alert/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -68,7 +68,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"am.example.com"},
Scheme: "https",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -78,7 +78,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"dns+localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -88,7 +88,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"dnssrv+localhost"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -98,7 +98,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost"},
Scheme: "ssh+http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -109,7 +109,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
Scheme: "https",
PathPrefix: "/path/prefix/",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -125,7 +125,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand Down

0 comments on commit 6da7c6d

Please sign in to comment.