-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sidecar: not ready when Prometheus is unavailable #4939
Conversation
Set Sidecar to not be ready when Prometheus is unavailable. This avoids problems when Prometheus is replaying WAL and Sidecar is "up" but then Query hangs while waiting for a response from Prometheus/Sidecar. Also, it gets shown as UP in the Stores page with no ext. labels during this time that is confusing. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
0c6f0fd
to
febb55c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a comment suggestion, otherwise LGTM. Thanks
defer runutil.CloseWithErrCapture(&rerr, resp.Body, "closing resp body") | ||
|
||
if resp.StatusCode == 200 { | ||
return fmt.Errorf("got status code %d", resp.StatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf("got status code %d", resp.StatusCode) | |
return fmt.Errorf("sidecar should not be ready, got HTTP status code %d OK", resp.StatusCode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why OK
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's what usually goes after 200
in the HTTP response https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200? (:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's what usually goes after
200
in the HTTP response https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200? (:
yes, in case someone doesn't know what status code 200
signifies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Printing the status code and OK the same time seems redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, can we merge this then @yeya24 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Philip Gough <philip.p.gough@gmail.com>
Changes
Set Sidecar to not be ready when Prometheus is unavailable. This avoids
problems when Prometheus is replaying WAL and Sidecar is "up" but then
Query hangs while waiting for a response from Prometheus/Sidecar. Also,
it gets shown as UP in the Stores page with no ext. labels during this
time that is confusing.
Verification
Improved e2e tests which pass.