Alerting: Fix rule state history with annotations backend (#101174)

* add alertUID to annotations API query parameter
* update state history UI to fetch rule by UID

---------

Signed-off-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Yuri Tseretyan
2025-02-21 23:08:40 +02:00
committed by GitHub
parent c33e908baf
commit bbeae46105
14 changed files with 97 additions and 24 deletions
+7 -1
View File
@@ -41,6 +41,7 @@ func (hs *HTTPServer) GetAnnotations(c *contextmodel.ReqContext) response.Respon
OrgID: c.SignedInUser.GetOrgID(),
UserID: c.QueryInt64("userId"),
AlertID: c.QueryInt64("alertId"),
AlertUID: c.Query("alertUID"),
DashboardID: c.QueryInt64("dashboardId"),
DashboardUID: c.Query("dashboardUID"),
PanelID: c.QueryInt64("panelId"),
@@ -744,10 +745,15 @@ type GetAnnotationsParams struct {
// in:query
// required:false
UserID int64 `json:"userId"`
// Find annotations for a specified alert.
// Find annotations for a specified alert rule by its ID.
// deprecated: AlertID is deprecated and will be removed in future versions. Please use AlertUID instead.
// in:query
// required:false
AlertID int64 `json:"alertId"`
// Find annotations for a specified alert rule by its UID.
// in:query
// required:false
AlertUID string `json:"alertUID"`
// Find annotations that are scoped to a specific dashboard
// in:query
// required:false