From 9e85757d89a72f556ab42a1b29a102dfd1beda3c Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Mon, 21 Sep 2020 10:38:15 -0400 Subject: [PATCH] adds prometheus ruler routes (#2650) --- pkg/loki/modules.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 4a32d7a33e51..1af76ab26c03 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -438,6 +438,10 @@ func (t *Loki) initRuler() (_ services.Service, err error) { t.server.HTTP.Handle("/ruler/ring", t.ruler) cortex_ruler.RegisterRulerServer(t.server.GRPC, t.ruler) + // Prometheus Rule API Routes + t.server.HTTP.Path("/prometheus/api/v1/rules").Methods("GET").Handler(t.httpAuthMiddleware.Wrap(http.HandlerFunc(t.ruler.PrometheusRules))) + t.server.HTTP.Path("/prometheus/api/v1/alerts").Methods("GET").Handler(t.httpAuthMiddleware.Wrap(http.HandlerFunc(t.ruler.PrometheusAlerts))) + // Ruler Legacy API Routes t.server.HTTP.Path("/api/prom/rules").Methods("GET").Handler(t.httpAuthMiddleware.Wrap(http.HandlerFunc(t.ruler.ListRules))) t.server.HTTP.Path("/api/prom/rules/{namespace}").Methods("GET").Handler(t.httpAuthMiddleware.Wrap(http.HandlerFunc(t.ruler.ListRules)))