Skip to content
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

Ability to exit http probe and fail build when any http probe fails #708

Open
tylersalminen opened this issue Aug 8, 2024 · 7 comments
Open
Labels

Comments

@tylersalminen
Copy link

A new CLI argument and / or environment variable (or modification of --http-probe-exit-on-failure / DSLIM_HTTP_PROBE_EXIT_ON_FAILURE) that allows the build to fail when any single http probe fails.

Current behavior is to fail when every http probe fails i.e. when the following condition is true:

probe.CallCount > 0 && probe.OkCount == 0 && opts.httpProbeOpts.ExitOnFailure
....

Would instead want something like

probe.ErrCount > 0 && opts.httpProbeOpts.ExitOnAnyFailure
....
@kcq kcq added the WIP label Aug 20, 2024
@kcq
Copy link
Member

kcq commented Aug 25, 2024

the new --http-probe-exit-on-failure-count flag in the new release (e.g., ----http-probe-exit-on-failure-count 1) should help with this

@tylersalminen
Copy link
Author

I tried this out today, it does not seem to be picking up that one of my http probes returned a 500 status error (you can see in the image that it determined that all probes were successful). This may be a separate issue from this change but thought I would bring this up here

image

@kcq
Copy link
Member

kcq commented Aug 27, 2024

Any kind of server response regardless of the http status code is considered to be a success. This is because the goal is to exercise the server app logic. In some cases, the http error codes are used to try different request parameters combinations. This happens with the openAPI spec based requests... mostly with POSTs.

@tylersalminen
Copy link
Author

Gotcha that makes sense, thanks for the response

@kcq
Copy link
Member

kcq commented Aug 28, 2024

It is possible to have a flag to fail on 5xx status codes.

@tylersalminen
Copy link
Author

If you believe it is appropriate to fit such a flag within your current framework I would definitely make use of it. There are some cases with the http probes I am setting up where I would like our deployment to fail if some unbound / unhandled exception occurred so that a possibly faulty image is not deployed.

@kcq
Copy link
Member

kcq commented Aug 30, 2024

--http-probe-fail-on-status-5xx will be available in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants