The built-in StatsD output has been deprecated on k6 v0.47.0. You can continue to use this feature by using the xk6-output-statsd extension, and this guide has been updated to include instructions for how to use it.
For more information on the reason behind this change, you can follow this issue in the k6 repository.
Build the k6 version
Then, open your terminal and run the following commands:
# Install xk6 go install go.k6.io/xk6/cmd/xk6@latest # Build the k6 binary xk6 build --with github.com/grafana/xk6-output-statsd ... [INFO] Build environment ready ... [INFO] Building k6 ... [INFO] Build complete: ./k6
xk6 will create the new k6 binary in the local folder.
Note: To learn more about how to build custom k6 versions, check out xk6.
Run the k6 test
Using the k6 binary you built in the previous step, you can use the
--out output-statsd option when running your tests to use this extension:
$ ./k6 run --out output-statsd script.js
The following options can be configured:
|Address of the statsd service, currently only UDP is supported. The default value is |
|The namespace used as a prefix for all the metric names. The default value is |
|Configure how often data batches are sent. The default value is |
|The buffer size. The default value is |
|This is a comma-separated list of tags that should NOT be sent to statsd. For example, “tag1,tag2”. The default value is |