Hello,
We run K6 via AWS Batch and DataDog agent is installed in the EC2 instance.
But some metrics are failed to send from container to DataDog agent.
level=debug msg=“Error while sending metric checks” error=“write udp 127.0.0.1:48615->127.0.0.1:8125: write: connection refused” output=statsd
level=warning msg=“Couldn’t send 7 out of 77 metrics. Enable verbose logging with --verbose to see individual errors” output=statsd
Our K6 version is v0.41.0.
Do you have any idea/solutions to solve this? Thank you in advance!
Well, what is the output when you enable --verbose? Do you see any errors that could explain it?
It might be that the amount of metrics sent by k6 overloads the Datadog Agent instance. You can try passing DD_LOGS_ENABLED=true in the docker run command, and checking if you see any relevant information. See their documentation.
You could also try experimenting with the values of K6_STATSD_PUSH_INTERVAL and K6_STATSD_BUFFER_SIZE to see if increasing or decreasing this improves the performance. See the statsd output documentation.
Thanks @imiric . When I change the value of K6_STATSD_PUSH_INTERVAL to 5, the errors are gone.
I am wondering whether the default value(1s) is a proper value.
When I change the value of K6_STATSD_PUSH_INTERVAL to 5, the errors are gone.
Good to know
I am wondering whether the default value(1s) is a proper value.
We try to set some sane defaults, but the most appropriate values will depend on each environment (hardware resources: CPU/RAM, network, etc.), which is why these are configurable. You can always export the value that works best for you, to make sure it’s always set when you run this test.