Skip to content

Conversation

moko-poi
Copy link
Contributor

@moko-poi moko-poi commented Sep 25, 2025

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.go and curl_stop.go to include -o /dev/null -s -w '{http_code="%{http_code}"}\n' flags

Before

❯ kubectl logs k6-curl-test-starter-bxwx6  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   237  100   150  100    87  36443  21137 --:--:-- --:--:-- --:--:-- 79000
{"data":{"type":"status","id":"default","attributes":{"status":4,"paused":false,"vus":0,"vus-max":1,"stopped":false,"running":false,"tainted":false}}}%

After

❯ k logs k6-curl-test-starter-r882m                                                                                                                                    ─╯
{"data":{"type":"status","id":"default","attributes":{"status":4,"paused":false,"vus":0,"vus-max":1,"stopped":false,"running":false,"tainted":false}}}
{"http_code":200,"time_total":0.004452,"time_starttransfer":0.004441,"url":"http://10.96.244.19:6565/v1/status","remote_ip":"10.96.244.19"}

Testing

  • Verified the change works as expected with k6 curl test containers
  • Log output is now concise and easier to parse while maintaining essential status information

Fixes #653

@moko-poi moko-poi requested a review from yorugac as a code owner September 25, 2025 10:37
@moko-poi
Copy link
Contributor Author

@yorugac
I've implemented it this way and the output looks like this:

{"data":{"type":"status","id":"default","attributes":{"status":4,"paused":false,"vus":0,"vus-max":1,"stopped":false,"running":false,"tainted":false}}}
{"http_code":200,"time_total":0.004452,"time_starttransfer":0.004441,"url":"http://10.96.244.19:6565/v1/status","remote_ip":"10.96.244.19"}

How does this look? Please let me know if you have any feedback, such as:

  • Whether we should combine them into a single JSON structure
  • If any of the metadata fields are unnecessary
  • If the response body should be omitted

@yorugac
Copy link
Collaborator

yorugac commented Sep 28, 2025

Thanks for the PR, @moko-poi!
Have you checked what kind of output this change would get on an error scenario too?

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

Successfully merging this pull request may close these issues.

Reduce log output of curl containers
2 participants