NetData - K6 -> Running using docker

Hi,

Im trying to send k6.io test results to NetData Node. Running both k6 & Netdata using Docker, no local installation.

K6.io tests run perfectly using docker but im unable to send/connect data to statsd/netdata.

cmd for Netdata:
-------------start-----------------------
version: ‘3’
services:
netdata:
image: netdata/netdata
container_name: netdata
ports:
- 19999:19999
restart: unless-stopped
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
volumes:
- netdataconfig:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro

volumes:
netdataconfig:
netdatalib:
netdatacache:
-------------end-----------------------

cmd for k6:
docker run --rm --platform linux/amd64 -i loadimpact/k6 run --out statsd - <performance-test.js

but no success. Can anyone point out the issue with cmd above or How to send data to statsd using docker. Dont want to install it locally bcoz we run the k6 performance tests on bitbucket pipeline.

Thanks!

I have tried some other variations for k6 docker cmd e.g:

docker run --rm --platform linux/amd64 -e K6_STATSD_ENABLE_TAGS=true K6_STATSD_ADDR=localhost:19999 -i loadimpact/k6 run --out statsd - <performance-test.js

The docker-compose cmd for Netdata mentioned in actual post is from: “Install Netdata with Docker | Learn Netdata

Hi @khalyl

Welcome to the forum! I think in your case K6_STATSD_ADDR variable is a must because your endpoint differs from the default one in k6 Statsd output but otherwise, I don’t see any issue with the command at first glance… What is the error you’re getting? Or maybe what is the logs output from docker k6 run? If there is nothing there, it might be useful to look at the logs of netdata container as well.

Just in case, have you checked k6’s netdata docs? Specifically, the part about networking caveats: it sounds as if it’d be applicable in your use case.