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

Function NewAPI

pkg/ruler/api.go:115–121  ·  view source on GitHub ↗

NewAPI returns a new API struct with the provided ruler and rule store

(r *Ruler, s rulestore.RuleStore, logger log.Logger)

Source from the content-addressed store, hash-verified

113
114// NewAPI returns a new API struct with the provided ruler and rule store
115func NewAPI(r *Ruler, s rulestore.RuleStore, logger log.Logger) *API {
116 return &API{
117 ruler: r,
118 store: s,
119 logger: logger,
120 }
121}
122
123func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) {
124 logger := util_log.WithContext(req.Context(), a.logger)

Callers 10

initRulerMethod · 0.92
TestRuler_rulesFunction · 0.70
TestRuler_rules_limitFunction · 0.70
TestRuler_alertsFunction · 0.70
TestRuler_CreateFunction · 0.70
TestRuler_LimitsPerGroupFunction · 0.70

Calls

no outgoing calls

Tested by 9

TestRuler_rulesFunction · 0.56
TestRuler_rules_limitFunction · 0.56
TestRuler_alertsFunction · 0.56
TestRuler_CreateFunction · 0.56
TestRuler_LimitsPerGroupFunction · 0.56