diff --git a/CHANGELOG.md b/CHANGELOG.md index e90aaf1325..a4b2cde109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Fixed - [#5502](https://github.com/thanos-io/thanos/pull/5502) Receive: Handle exemplar storage errors as conflict error. +- [#5534](https://github.com/thanos-io/thanos/pull/5534) Query: Set struct return by query api alerts same as prometheus api ### Added diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index 7a8fbf5fca..fbc9a18169 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -794,7 +794,9 @@ func NewAlertsHandler(client rules.UnaryClient, enablePartialResponse bool) func return nil, nil, &api.ApiError{Typ: api.ErrorInternal, Err: errors.Errorf("error retrieving rules: %v", err)} } - var resp struct{ Alerts []*rulespb.AlertInstance } + var resp struct { + Alerts []*rulespb.AlertInstance `json:"alerts"` + } for _, g := range groups.Groups { for _, r := range g.Rules { a := r.GetAlert()