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)))