[Alerting]: Implement test rule API route (#32837)

* [Alerting]: Implement test rule API route

* Apply suggestions from code review

* Call /query instead of /query_range
This commit is contained in:
Sofia Papagiannaki
2021-04-13 20:58:34 +03:00
committed by GitHub
parent 15978900a9
commit e7ff04a167
12 changed files with 293 additions and 112 deletions
+7 -2
View File
@@ -77,8 +77,13 @@ func (api *API) RegisterAPIEndpoints() {
NewLotexRuler(proxy, logger),
RulerSrv{store: api.RuleStore, log: logger},
))
// Register endpoints for testing evaluation of rules and notification channels.
api.RegisterTestingApiEndpoints(TestingApiMock{log: logger})
api.RegisterTestingApiEndpoints(TestingApiSrv{
AlertingProxy: proxy,
Cfg: api.Cfg,
DataService: api.DataService,
DatasourceCache: api.DatasourceCache,
log: logger,
})
// Legacy routes; they will be removed in v8
api.RouteRegister.Group("/api/alert-definitions", func(alertDefinitions routing.RouteRegister) {