K6 does not send default metrics to statsd output

Hello all,
I am using --out statsd output to get metrics from K6.
I am able to get some default metrics such as ‘k6_checks’, ‘k6_vus’ as well as custom metrics, but get nothing from the ‘k6_http_req_’ default metrics.
If I am using the --out influxdb output, I do get those ‘http_req_’ default metrics, so probably something with statsd / k6-statsd configuration.

My k6-statsd config is -

K6_STATSD_ENABLE_TAGS: true
K6_STATSD_PUSH_INTERVAL: 100ms

And the statsd config is -

protocol = "udp"
service_address = ":8125"
datadog_extensions = true

Also, I can see the fields in the k6 logs so it does report it -

4
     checks.........................: 50.00% ✓ 550      ✗ 550
23
     data_received..................: 264 kB 1.3 kB/s
22
     data_sent......................: 328 kB 1.6 kB/s
21
     frizzle_message_sent...........: 350    1.666619/s
20
     http_req_blocked...............: avg=217.01µs min=906ns    med=4.06µs  max=5.91ms   p(90)=781.78µs p(95)=1.3ms
19
     http_req_connecting............: avg=191.46µs min=0s       med=0s      max=1.65ms   p(90)=714.13µs p(95)=1.24ms
18
   ✗ http_req_duration..............: avg=30.5ms   min=11.11ms  med=23.22ms max=239.67ms p(90)=54.82ms  p(95)=71.13ms
17
       { expected_response:true }...: avg=30.5ms   min=11.11ms  med=23.22ms max=239.67ms p(90)=54.82ms  p(95)=71.13ms
16
   ✓ http_req_failed................: 0.00%  ✓ 0        ✗ 550
15
     http_req_receiving.............: avg=36.19µs  min=12.8µs   med=34.34µs max=82.54µs  p(90)=57.3µs   p(95)=62.04µs
14
     http_req_sending...............: avg=29.73µs  min=6.13µs   med=25.87µs max=87.58µs  p(90)=60.66µs  p(95)=63.53µs
13
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s      max=0s       p(90)=0s       p(95)=0s
12
     http_req_waiting...............: avg=30.44ms  min=11.08ms  med=23.15ms max=239.63ms p(90)=54.77ms  p(95)=71.1ms
11
     http_reqs......................: 550    2.618972/s
10
     iteration_duration.............: avg=30.68ms  min=18.16ms  med=23.05ms max=927ms    p(90)=33.93ms  p(95)=35.54ms
9
     iterations.....................: 201    0.957115/s
8
     vus............................: 105    min=1      max=110
7
     vus_max........................: 110    min=110    max=110
6
     ws_connecting..................: avg=18.07ms  min=13.82ms  med=17.21ms max=36.57ms  p(90)=20.14ms  p(95)=27ms
5
     ws_msgs_received...............: 350    1.666619/s
4
     ws_ping........................: avg=1.35ms   min=500.92µs med=1.31ms  max=3.49ms   p(90)=1.95ms   p(95)=2.05ms
3
     ws_sessions....................: 100    0.476177/s

Does someone have any idea?

Hi @idanlisman !

My version of the k6 is:

k6 version
k6 v0.40.0 (v0.40.0, go1.19, linux/amd64)

I’ve checked locally with the simple script:

import { sleep } from "k6";
import http from "k6/http";

export default function () {
  http.get('http://test.k6.io');
  
  sleep(1);
} 

which I run:

K6_STATSD_ENABLE_TAGS=true K6_STATSD_PUSH_INTERVAL=100ms k6 run --out statsd script.js

and locally running statsd

docker run --rm -v $PWD/config.js:/usr/src/app/config.js -p 8125:8125/udp -p 8126:8126 statsd/statsd

with the config.js

 {"dumpMessages": true}

and I’m able to see the metrics:

So it seems like it’s statsd config issue, but just in case, what is your version?

Cheers!

1 Like