K6 operator logs differ from running locally

When running my k6 test locally, it outputs information about all the scenarios that ran. However, running inside k8s cluster with the k6-operator, the log from the test pod does not include any information about the scenarios ran.

From pod log:

     █ setup

     █ teardown

     data_received..................: 17 kB  185 B/s
     data_sent......................: 7.6 kB 85 B/s
     http_req_blocked...............: avg=39.52µs min=3.45µs  med=4.22µs  max=1.01ms   p(90)=17.52µs p(95)=18.64µs
     http_req_connecting............: avg=6.45µs  min=0s      med=0s      max=193.6µs  p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=10.67ms min=9.59ms  med=10.46ms max=14.57ms  p(90)=11.35ms p(95)=12.5ms 
       { expected_response:true }...: avg=10.67ms min=9.59ms  med=10.46ms max=14.57ms  p(90)=11.35ms p(95)=12.5ms 
     http_req_failed................: 0.00%  ✓ 0       ✗ 30 
     http_req_receiving.............: avg=61.2µs  min=48.92µs med=58.07µs max=118.68µs p(90)=71.88µs p(95)=77.22µs
     http_req_sending...............: avg=18.92µs min=14.1µs  med=17.12µs max=50.55µs  p(90)=22.07µs p(95)=22.84µs
     http_req_tls_handshaking.......: avg=0s      min=0s      med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=10.59ms min=9.53ms  med=10.38ms max=14.48ms  p(90)=11.28ms p(95)=12.4ms 
     http_reqs......................: 30     0.33332/s
     iteration_duration.............: avg=10.17ms min=8.46µs  med=10.55ms max=14.69ms  p(90)=11.41ms p(95)=12.98ms
     iterations.....................: 30     0.33332/s
     vus............................: 0      min=0     max=0
     vus_max........................: 1      min=1     max=1

From local run otput:

 scenarios: (100.00%) 1 scenario, 1 max VUs, 35s max duration (incl. graceful stop):
           * TEST_SCENARIO: 1.00 iterations/s for 5s (maxVUs: 1, exec: doTest, gracefulStop: 30s)

     █ setup

     █ teardown

     data_received..................: 4.0 kB 792 B/s
     data_sent......................: 1.3 kB 264 B/s
     http_req_blocked...............: avg=28.32µs  min=3.62µs  med=4.57µs  max=148.13µs p(90)=76.44µs  p(95)=112.28µs
     http_req_connecting............: avg=15.73µs  min=0s      med=0s      max=94.42µs  p(90)=47.21µs  p(95)=70.81µs 
     http_req_duration..............: avg=162.05ms min=18.47ms med=50.29ms max=773.67ms p(90)=416.51ms p(95)=595.09ms
       { expected_response:true }...: avg=162.05ms min=18.47ms med=50.29ms max=773.67ms p(90)=416.51ms p(95)=595.09ms
     http_req_failed................: 0.00%  ✓ 0        ✗ 6  
     http_req_receiving.............: avg=70.81µs  min=57.24µs med=72.14µs max=84.98µs  p(90)=79.46µs  p(95)=82.22µs 
     http_req_sending...............: avg=21.43µs  min=15.33µs med=17.59µs max=31.08µs  p(90)=30.92µs  p(95)=31µs    
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s      max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=161.96ms min=18.4ms  med=50.2ms  max=773.56ms p(90)=416.41ms p(95)=594.98ms
     http_reqs......................: 6      1.195033/s
     iteration_duration.............: avg=121.67ms min=8.38µs  med=35.38ms max=773.98ms p(90)=273.86ms p(95)=523.92ms
     iterations.....................: 6      1.195033/s
     vus............................: 0      min=0      max=0
     vus_max........................: 1      min=1      max=1


running (05.0s), 0/1 VUs, 6 complete and 0 interrupted iterations
TEST_SCENARIO ✓ [======================================] 0/1 VUs  5s  1.00 iters/s

Am I missing some configuration?

Hi @vvasilevbosch, welcome to the community forum!

It is because k6-operator starts the test in quiet mode by default. You can set it false with adding this line to your K6 resource yaml file

  quiet: "false"

But you can also find some information about the scenarios in the log of the initializer pod

2 Likes

Thanks for the fast reply, is this documented somewhere?

Here is the quiet flag documentation for k6:

Maybe it is not documented at the k6-operator. You can find it in the source code here : k6-operator/pkg/resources/jobs/runner.go at 1d97a47e471b89dc34258524759d8f93b9a81649 · grafana/k6-operator · GitHub

I watched the test pod’s resource descriptor with kubectl get pod -o yaml <podname> and I saw there the --quiet flag, then I tried to figure it out how could I disable it, so I watched the K6 resource configuration options with kubectl explain K6.spec and there I found the quiet option

2 Likes

Thank you!

1 Like