Skip to content

Commit 0e83237

Browse files
authored
Change log level for 4xx on Push API. Do not log on 429 (#5103)
* Remove error logs in case API returns 4xx Signed-off-by: Daniel Deluiggi <[email protected]> * Update chnagelog Signed-off-by: Daniel Deluiggi <[email protected]> * Change to just not log in 429 Signed-off-by: Daniel Deluiggi <[email protected]> Signed-off-by: Daniel Deluiggi <[email protected]>
1 parent 4f15011 commit 0e83237

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## master / unreleased
44
* [CHANGE] Alertmanager: Local file disclosure vulnerability in OpsGenie configuration has been fixed. #5045
5+
* [CHANGE] Distributor/Ingester: Log warn level on push requests when they have status code 4xx. Do not log if status is 429. #5103
56
* [ENHANCEMENT] Update Go version to 1.19.3. #4988
67
* [ENHANCEMENT] Querier: limit series query to only ingesters if `start` param is not specified. #4976
78
* [ENHANCEMENT] Query-frontend/scheduler: add a new limit `frontend.max-outstanding-requests-per-tenant` for configuring queue size per tenant. Started deprecating two flags `-query-scheduler.max-outstanding-requests-per-tenant` and `-querier.max-outstanding-requests-per-tenant`, and change their value default to 0. Now if both the old flag and new flag are specified, the old flag's queue size will be picked. #5005

pkg/util/push/push.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ func Handler(maxRecvMsgSize int, sourceIPs *middleware.SourceIPExtractor, push F
4747
http.Error(w, err.Error(), http.StatusInternalServerError)
4848
return
4949
}
50-
if resp.GetCode() != 202 {
50+
if resp.GetCode()/100 == 5 {
5151
level.Error(logger).Log("msg", "push error", "err", err)
52+
} else if resp.GetCode() != http.StatusAccepted && resp.GetCode() != http.StatusTooManyRequests {
53+
level.Warn(logger).Log("msg", "push refused", "err", err)
5254
}
5355
http.Error(w, string(resp.Body), int(resp.Code))
5456
}

0 commit comments

Comments
 (0)