-
Notifications
You must be signed in to change notification settings - Fork 192
fix: reduce curl container log output to single line status #654
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
Conversation
|
@yorugac How does this look? Please let me know if you have any feedback, such as:
|
|
Thanks for the PR, @moko-poi! |
|
Hi @yorugac! Yes, I've tested the error scenario as well. Here's what the output looks like when the starter curl fails to connect to the k6 runner This structured JSON format makes it much easier to diagnose connection issues compared to the previous simple {http_code="000"} output, providing additional timing and network-level details for troubleshooting. |
|
Thanks, @moko-poi! So on error it's just one line, not two? |
|
Hi @yorugac, The test I conducted was specifically for the scenario where the k6 runner is not running, causing the start operation to fail. In this case:
So the single-line output See: https://stackoverflow.com/questions/9791684/what-is-http-status-code-000 |
|
Additionally, I've also tested scenarios where k6 is running but returns HTTP errors using the exact same curl commands as our starter/stopper containers: HTTP Error Response Test (k6 running but returning errors) Using the exact starter command from curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://k6:6565/v1/status -d '{"data":{"attributes":{"paused":false},"id":"default","type":"status"}}' -s -w '...'Result (HTTP 500) Successful stopper command test |
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.
Hi @moko-poi, thanks for the details.
I think I've found how to add the readable error here:
https://daniel.haxx.se/blog/2021/01/27/curl-your-own-error-message/
%{errormsg}: it seems to work as expected, AFAIS. Could you please add that one?
I think we should as explicit as possible on error scenarios, esp. given that this error means a networking problem within a cluster.
|
Thank you @yorugac ! |
Summary
Reduces curl container log output from verbose multi-line format to a clean single-line status format as requested in issue #653.
Changes
Modified curl commands in
curl_start.goandcurl_stop.goto include-o /dev/null -s -w '{http_code="%{http_code}"}\n'flagsBefore
After
Testing
Fixes #653