Originally posted at https://grafana.com/blog/2023/04/27/grafana-k6-v0.44.0-release-web-crypto-api-web-vitals-metrics-and-more/
Grafana k6 v0.44.0 has been released, featuring new experimental modules, an upgraded browser module, and tons of improvements.
Here’s a quick overview of the latest k6 news from the team and the community:
Grafana k6 v0.44.0 release
This release includes a new experimental web crypto module to perform basic cryptographic operations such as signing, hashing, verification, encryption, and decryption from your k6 tests. This module implements the Web Crypto API specification, and this first release has covered a subset of the most common APIs.
The tracing module now adds support for probabilistic sampling. With the sampling option, you can now configure the percentage of HTTP requests with tracing data to reduce costs. Load tests can generate vast data, but you might not need to trace all the requests to analyze the system’s behavior and identify root causes.
Performance is also critical for k6, as large tests can overload memory and skew your testing results without notice. This release has optimized how virtual users (VUs) manage their internal buffer, reducing memory consumption by up to 50%. And we have also included a warning message when too much data could lead to out-of-memory issues.
The release included more internal improvements, minor changes, and fixes from the k6 team and the community. Check out the full list in the release notes.
k6 Browser updates
k6 browser lets you automate browser actions and collect web performance metrics. In this release, the team has continued to add new features and improvements, which include:
locator.click
API to now be asynchronous and supports theawait
operator.- New APIs, such as
browserContext.addCookies
andbrowserType.connect
, which allow you to add cookies in your browser context and connect to a remote browser instance, respectively. - Browser metrics now support Google Web Vitals.
- Various UX improvements and bug fixes.
To learn more about browser performance testing with k6, check out our web page on hybrid website performance testing.
️Introducing Grafana Cloud k6
In March, we announced the general availability of Grafana Cloud k6, our managed performance testing solution in Grafana Cloud. If you want to try it out, Grafana Cloud has a free-forever plan with 500 virtual user hours per month. (Sign up for free today!)
Note: Existing k6 Cloud customers will not be impacted — they will be migrated to the new experience at a later date.
We continue porting capabilities from k6 Cloud into Grafana Cloud k6. Some of the latest additions were:
- Easier navigation between test runs.
- Add the option to compare test runs.
- Support editing environment variables.
- Support managing Grafana API Stack Tokens.
- Save and set a baseline test run.
For more information, take a look at the blog announcement and the Grafana Cloud k6 documentation, or tune in to the latest k6 Office Hours.
k6-operator improvements
k6-operator, the Kubernetes operator for running distributed k6 tests, received some significant changes with the latest v0.0.9 release:
- An initializer specification to allow independent configuration of the Initializer pods. It may come in handy for the cases requiring more fine-grained control over security of the setup, more complex workflow of logic, etc.
- Basic implementation of Liveness and Readiness probes for Runner pods allows for monitoring the health of the test run with usual Ops tooling.
- Upgrades for k6, Go version, and dependencies, including a major update of controller-runtime.
- Idempotence of the operator was improved greatly, strengthening its resilience in general and allowing it to run simultaneous tests with cloud output (
--out cloud
). - Features from the pre-releases are included.
Stay tuned as more features are added.
New in the xk6-disruptor
xk6-disruptor allows for testing the resilience of your services by injecting application failures. Since the last update, we have added support for injecting faults to gRPC services:
- PodDisruptor.injectGrpcFaults() for disrupting Kubernetes pods.
- ServiceDisruptor.injectGrpcFaults() for disrupting Kubernetes services.
Also, the latest version introduces a breaking change to maintain consistency with k6 APIs. Now, like k6, duration-based parameters are represented as string types.
The latest on k6 Extensions
xk6 now publishes a Docker image, so you can build your custom k6 binary without installing the Go environment! Check out this video and guide for the instructions.
We want to make the extensions ecosystem more organized and ensure extensions are not abandoned. For this, we’re working to ensure that any extensions listed on our site will adhere to a minimum set of requirements.
The following extensions were brought up to date with dependencies and CI workflows: xk6-docker, xk6-exec, xk6-loki, xk6-output-kafka, xk6-sql, xk6-ssh.
In addition, we introduced the following improvements:
- xk6-kubernetes, the new generic resources API has now reached feature parity with the older deprecated APIs with release v0.4.0. With v0.5.0 and beyond, those deprecated APIs were fully removed and dependencies upgraded to the latest versions.
- xk6-output-influxdb upgraded dependencies and now provides an improved Grafana dashboard thanks to contributor @toscott.
We’re also aware of the following updates from the community:
- mostafa/xk6-kafka received some updates around AWS IAM and support for Java Keystores (JKS).
- A special shout out to @szkiba, who revamped szkiba/xk6-mock and has been bursting with updates to szkiba/xk6-dashboard, szkiba/xk6-prometheus, szkiba/xk6-faker, szkiba/xk6-dotenv, szkiba/xk6bundler, szkiba/xk6-csv, szkiba/xk6-yaml, szkiba/xk6-ansible-vault, and szkiba/xk6-toml. This brings multiple popular extensions up to date with a more recent k6 version.
- tarantool/xk6-tarantool moved to the tarantool organization along with updates to a recent k6 version in order to load test Tarantool datastores.
- martymarron/xk6-output-prometheus-pushgateway updated to a recent version of k6 as well as various improvements.
In addition to all of these updates, the following new extensions have been discovered:
- thmshmm/xk6-opentelemetry is a new extension for producing logs, metrics, and traces to load test your preferred OpenTelemetry Collector.
- aseara/xk6-m3u8 allows for downloading audio or video streams in the m3u8 format.
- szkiba/xk6-top now makes it possible to have the k6 metrics summary update on the terminal during a test run.
- szkiba/xk6-enhanced adds enhanced JavaScript compatibility to k6 scripts.
- szkiba/my-k6 will let you define and build custom k6 binaries using a GitHub workflow.
Last, we want more feedback from you—the community. The Extensions User Survey is still open and will help us better understand your needs and desires.
Upgrades in JSLib
The JSLib AWS module is a custom JavaScript library designed to interact with certain Amazon Web Services (AWS) from your k6 tests.
In the most recent version, v0.72.0, a client has been added to interact with Amazon Simple Queue Service (SQS). The SQSClient.sendMessage and SQSClient.listQueues functions are now available for sending messages to SQS queues and listing the available queues, respectively.
Thanks to the k6 community
This has been a truly amazing release cycle for the k6 ecosystem! The k6 project has also surpassed the 20,000 GitHub star milestone this month, so we want to give a huge thank you to everyone who contributes to enhancing k6 and expanding the community.
So, what is next on our agenda? k6 OSS release cycles occur every two months, so you can anticipate the next k6 release (v0.45.0) to arrive in June. In the meantime, if you are interested in upcoming k6 news or want to connect with the k6 community, please join us on Slack, Twitter, LinkedIn, or YouTube. See you there!
Happy testing!