Skip to content

Commit

Permalink
adds prometheus ruler routes (#2650)
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-d authored Sep 21, 2020
1 parent 899e8cc commit 9e85757
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/loki/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 9e85757

Please sign in to comment.