(r *http.Request)
| 319 | } |
| 320 | |
| 321 | func 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 | |
| 335 | func (a *API) PrometheusAlerts(w http.ResponseWriter, req *http.Request) { |
| 336 | logger := util_log.WithContext(req.Context(), a.logger) |
no test coverage detected