Merge pull request #3013 from sinkingpoint/sinkingpoint/log_change

Move api error logs to debug
This commit is contained in:
Simon Pasquier 2022-08-05 17:02:54 +02:00 committed by GitHub
commit c732372d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -227,14 +227,14 @@ func (api *API) getAlertsHandler(params alert_ops.GetAlertsParams) middleware.Re
matchers, err := parseFilter(params.Filter)
if err != nil {
level.Error(logger).Log("msg", "Failed to parse matchers", "err", err)
level.Debug(logger).Log("msg", "Failed to parse matchers", "err", err)
return alertgroup_ops.NewGetAlertGroupsBadRequest().WithPayload(err.Error())
}
if params.Receiver != nil {
receiverFilter, err = regexp.Compile("^(?:" + *params.Receiver + ")$")
if err != nil {
level.Error(logger).Log("msg", "Failed to compile receiver regex", "err", err)
level.Debug(logger).Log("msg", "Failed to compile receiver regex", "err", err)
return alert_ops.
NewGetAlertsBadRequest().
WithPayload(
@ -356,7 +356,7 @@ func (api *API) getAlertGroupsHandler(params alertgroup_ops.GetAlertGroupsParams
matchers, err := parseFilter(params.Filter)
if err != nil {
level.Error(logger).Log("msg", "Failed to parse matchers", "err", err)
level.Debug(logger).Log("msg", "Failed to parse matchers", "err", err)
return alertgroup_ops.NewGetAlertGroupsBadRequest().WithPayload(err.Error())
}
@ -494,7 +494,7 @@ func (api *API) getSilencesHandler(params silence_ops.GetSilencesParams) middlew
for _, matcherString := range params.Filter {
matcher, err := labels.ParseMatcher(matcherString)
if err != nil {
level.Error(logger).Log("msg", "Failed to parse matchers", "err", err)
level.Debug(logger).Log("msg", "Failed to parse matchers", "err", err)
return alert_ops.NewGetAlertsBadRequest().WithPayload(err.Error())
}