MCPcopy Index your code
hub / github.com/cortexproject/cortex / ServeHTTP

Method ServeHTTP

pkg/ruler/ruler.go:670–688  ·  view source on GitHub ↗
(w http.ResponseWriter, req *http.Request)

Source from the content-addressed store, hash-verified

668}
669
670func (r *Ruler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
671 if r.cfg.EnableSharding {
672 r.ring.ServeHTTP(w, req)
673 } else {
674 var unshardedPage = `
675 <!DOCTYPE html>
676 <html>
677 <head>
678 <meta charset="UTF-8">
679 <title>Cortex Ruler Status</title>
680 </head>
681 <body>
682 <h1>Cortex Ruler Status</h1>
683 <p>Ruler running with shards disabled</p>
684 </body>
685 </html>`
686 util.WriteHTMLResponse(w, unshardedPage)
687 }
688}
689
690func (r *Ruler) run(ctx context.Context) error {
691 level.Info(r.logger).Log("msg", "ruler up and running")

Callers 6

TestRuler_ListAllRulesFunction · 0.45
TestRuler_CreateFunction · 0.45
TestRuler_LimitsPerGroupFunction · 0.45

Calls 1

WriteHTMLResponseFunction · 0.92

Tested by 6

TestRuler_ListAllRulesFunction · 0.36
TestRuler_CreateFunction · 0.36
TestRuler_LimitsPerGroupFunction · 0.36