release notes/v0.28.0.md
k6 v0.28.0 is here! :tada: It's a small release that adds some much requested features and a few important bugfixes!
Starting with this release, we'll be trying to stick to a new 8-week fixed release schedule for new k6 versions. This release comes ~8 weeks after v0.27.0 was released, and k6 v0.29.0 should be released in mid-November.
Logs from distributed k6 cloud test runs will now be shown in the terminal that executed the k6 cloud command, as well as in the k6 cloud web app on app.k6.io! :tada: This means that, if your script contains console.log() / console.warn() / etc. calls, or some of your requests or iterations fail, you'd be able to see that and debug them much more easily! Even --http-debug data should be proxied, up to 10000 bytes per message. To prevent abuse and not to overwhelm any user terminals, cloud logs are rate-limited at 10 messages per second per instance, for now, but that should be more than enough to debug most issues!
This feature is enabled by default, though you can disable it with k6 cloud --show-logs=false script.js.
k6 can now push its execution logs to a loki server! This can be done via the new --log-output CLI flag or the K6_LOG_OUTPUT environment variable option. For example, k6 run --log-output "loki=https://my-loki-server/loki/api/v1/push,limit=100,level=info,msgMaxSize=10000" will push up to 100 k6 log messages per second, of severity INFO and up, truncated to 10000 bytes, to https://my-loki-server.
@calavera added an extension for the host mapping feature. Now you can specify different port numbers via the hosts option, like this:
import http from 'k6/http';
export let options = {
hosts: {
'test.k6.io': '127.0.0.1:8080',
},
};
@TamiTakamiya added support for specifying the data type (int/float/bool/string) of fields that are emitted to InfluxDB outputs.
In order to specify the data type, you should:
K6_INFLUXDB_TAGS_AS_FIELDS, which is used to specify which k6 metric tag values should be sent as nonindexable fields (instead of tags) to an InfluxDB output. This is specified as a comma-separated string, and is now extended to optionally allow specifying a data type to each name.(name):(data_type), for example, event_processing_time:int.int, float, bool and string) can be specified to one field name.data_type are omitted, for example transaction_id, it is interpreted as a string field.A complete example can look like this: export K6_INFLUXDB_TAGS_AS_FIELDS="vu:int,iter:int,url:string,boolField:bool,floatField:float"
Note: If you have existing InfluxDB databases that contain fields whose data types are different from the ones that you want to save in future k6 test executions, you may want to create a new database or change field names as the current InfluxDB offers limited support for changing fields' data type. See the InfluxDB documentation for more details.
@thejasbabu added support to gzip archiving the file emitted by the CSV output on the fly. To use it, simply append .gz at the end of the file name, like this: k6 run --out csv=test.csv.gz test.js
source field specifying if a log comes from console, http-debug or stacktrace (when an exception has bubbled to the top of the iteration).hosts port mapping (#1489). Thanks, @calavera!name metric tag for redirected requests (#1474).divide by zero panic caused by some unusual execution environments that present a TTY, but return 0 for the terminal size (#1581).K6_DATADOG_TAG_BLACKLIST (#1602).tlsCipherSuites and tlsVersion (#1603). Thanks, @berndhartzer!ws.SetTimeout() and ws.SetInterval() panic when float values were passed (#1608).--compatibility-mode=base now supports some standard library features from ES6 (goja's PR), though no new syntax yet. In future versions we plan to drop some current core.js modules that are no longer needed, which should greatly reduce memory usage per VU (#1588).dep (#1584).k6 cloud will now proxy execution logs back to the client machine. To disable this behavior, use k6 cloud --show-logs=false.
--http-debug request and response dumps are now emitted through the logging sub-system, to facilitate the cloud log proxying (#1577).