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

Function parseExcludeAlerts

pkg/ruler/api.go:321–333  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

319}
320
321func parseExcludeAlerts(r *http.Request) (bool, error) {
322 excludeAlertsParam := strings.ToLower(r.URL.Query().Get("exclude_alerts"))
323
324 if excludeAlertsParam == "" {
325 return false, nil
326 }
327
328 excludeAlerts, err := strconv.ParseBool(excludeAlertsParam)
329 if err != nil {
330 return false, fmt.Errorf("error converting exclude_alerts: %w", err)
331 }
332 return excludeAlerts, nil
333}
334
335func (a *API) PrometheusAlerts(w http.ResponseWriter, req *http.Request) {
336 logger := util_log.WithContext(req.Context(), a.logger)

Callers 1

PrometheusRulesMethod · 0.85

Calls 2

GetMethod · 0.65
QueryMethod · 0.65

Tested by

no test coverage detected