Alerting: API to convert submitted Prometheus rules to GMA (#102231)

* placeholder commit

* Complete function in api_convert_prometheus.go

* MVP before extensive testing

* Cleanup

* Updated tests

* cleanup

* Fix random logs and lint

* Remove comment

* Fix errors after rebase

* Update test

* Update swagger

* swagger

* Refactor to accept groups in body

* Fix auth tests and some cleanup

* Some cleanup before refactoring

* Remove unnecessary fields

* Also refactor RouteConvertPrometheusPostRuleGroup

* Remove unused code

* Rebase + cleanup

* Update authorization_test

* address comments

* Regen swagger files

* Remove namespace and group filters

* Final comments
This commit is contained in:
Fayzal Ghantiwala
2025-03-27 15:30:11 +00:00
committed by GitHub
parent d7be68ab3c
commit 68d8810ecb
12 changed files with 488 additions and 41 deletions
+3 -1
View File
@@ -128,7 +128,9 @@ func (api *API) authorize(method, path string) web.Handler {
)
case http.MethodPost + "/api/convert/prometheus/config/v1/rules/{NamespaceTitle}",
http.MethodPost + "/api/convert/api/prom/rules/{NamespaceTitle}":
http.MethodPost + "/api/convert/api/prom/rules/{NamespaceTitle}",
http.MethodPost + "/api/convert/prometheus/config/v1/rules",
http.MethodPost + "/api/convert/api/prom/config/v1/rules":
eval = ac.EvalAll(
ac.EvalPermission(ac.ActionAlertingRuleCreate),
ac.EvalPermission(ac.ActionAlertingProvisioningSetStatus),