mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Remote Write: Close connection after 3 retries
I propose a change in remote write. If we error out for > 3 times, then we close the connection. This is to htlp with user that are using load balancers and DNS, where the active connection might point to a wrong DNS entry but the load balancer of the old entry is still active, replying 503. Signed-off-by: Julien <roidelapluie@o11y.eu>
This commit is contained in:
parent
ad4857de52
commit
03fc1567f4
|
@ -271,6 +271,7 @@ func (c *Client) Store(ctx context.Context, req []byte, attempt int) (WriteRespo
|
|||
|
||||
if attempt > 0 {
|
||||
httpReq.Header.Set("Retry-Attempt", strconv.Itoa(attempt))
|
||||
httpReq.Close = attempt > 3
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(ctx, c.timeout)
|
||||
|
|
Loading…
Reference in a new issue