UNCLASSIFIED - NO CUI

Skip to content

Update dependency grafana/k6 to v0.45.0

renovate requested to merge renovate/grafana-k6-0.x into development

This MR contains the following updates:

Package Type Update Change
grafana/k6 ironbank-github minor v0.44.1 -> v0.45.0
grafana/k6 minor v0.44.1 -> v0.45.0

Release Notes

grafana/k6

v0.45.0

Compare Source

k6 v0.45.0 is here 🎉! This release includes:

  • Experimental gRPC streaming support.
  • Update scripts in the cloud without running tests.
  • JS Metadata API.
  • A lot of internal changes and bugfixes.
Breaking changes
New features
Experimental gRPC module with streaming support #​3107

There is a new experimental module k6/experimental/grpc. It is a copy of the k6/net/grpc module with added stream support #​2020.

Expand to see an example of the new functionality.

This example shows server streaming:

import { Client, Stream } from 'k6/experimental/grpc';
import { sleep } from 'k6';

const COORD_FACTOR = 1e7;
// to run this sample, you need to start the grpc server first.
// to start the grpc server, run the following command in k6 repository's root:
// go run -mod=mod examples/grpc_server/*.go
// (golang should be installed)
const GRPC_ADDR = __ENV.GRPC_ADDR || '127.0.0.1:10000';
const GRPC_MROTO_PATH = __ENV.GRPC_MROTO_PATH || '../../grpc_server/route_guide.proto';

let client = new Client();

client.load([], GRPC_MROTO_PATH);

export default () => {
  client.connect(GRPC_ADDR, { plaintext: true });

  const stream = new Stream(client, 'main.FeatureExplorer/ListFeatures', null);

  stream.on('data', function (feature) {
    console.log(
      'Found feature called "' +
        feature.name +
        '" at ' +
        feature.location.latitude / COORD_FACTOR +
        ', ' +
        feature.location.longitude / COORD_FACTOR
    );
  });

  stream.on('end', function () {
    // The server has finished sending
    client.close();
    console.log('All done');
  });

  stream.on('error', function (e) {
    // An error has occurred and the stream has been closed.
    console.log('Error: ' + JSON.stringify(e));
  });

  // send a message to the server
  stream.write({
    lo: {
      latitude: 400000000,
      longitude: -750000000,
    },
    hi: {
      latitude: 420000000,
      longitude: -730000000,
    },
  });

  sleep(0.5);
};

You can just replace k6/net/grpc import with k6/experimental/grpc to use the new functionality. Documentation for the module is available here.

In the future, this functionality will be moved to the k6/net/grpc module.

You can now only upload a test to the cloud without running it #​3030

For years users have wanted to be able to update the test that is saved in the cloud but not run it at this exact point.

This is now possible by adding --upload-only when invoking k6 cloud as in k6 cloud --upload-only script.js.

This is likely going to be most useful in a CI on the actual test script project. Now that CI can just run k6 cloud --upload-only new-version-of-script.js on "release".

And later on that newer version will be used. For example by a scheduled run.

Setting sample metadata API #​3037

Support for high-cardinality metrics metadata was added in v0.41.0, but it wasn't accessible from test scripts. It's now possible to set or delete metadata for the whole VU with a similar API as used for tags:

import exec from "k6/execution";

export default () => {
  exec.vu.metrics.metadata["my_cool_id"] = "a very unique value";
  // all metrics from here on will have this metadata set
  delete exec.vu.metrics.metadata["my_cool_id"];
  // all metrics from here on will *not* have the metadata set
}

This also introduces the sub-object metrics on the vu object. Apart from metadata it has another property tags. This is meant to be the new way to set tags instead of using exec.vu.tags.

There are no current plans to replace exec.vu.tags with exec.vu.metrics.tags.

UX improvements and enhancements
  • #​3099 replace "breached" with "crossed" in logs around thresholds. Thanks to @​MattDodsonEnglish 🙇.
  • #​3102 Better error message when SharedArray constructor is provided with an async function. This is not supported, but the original message wasn't very clear.
  • #​3089 Add Software Bill of Materials (SBOM) reports to k6 releases. Thanks to @​SadFaceSmith 🙇.
  • goja#​510 JSON.parse will now fail with a friendlier error message.
Bug fixes
Maintenance and internal improvements
  • #​2991 Refactor JS modules system so that is usable in tests. Which allowed enabling the tc39 tests for modules #​3040.
  • #​3025 Internally stop referring to afero and use an internal package to do all file system interaction. That package still uses afero.
  • #​3036 and #​3053 Add options to scenarios for usage by browser module.
Roadmap

We're excited to share our public roadmap, outlining the upcoming features and improvements we have planned.

We hope this updated roadmap provides a clear overview of our plans for k6's future development. As always, we welcome feedback, corrections, and suggestions to make this roadmap more comprehensive, accessible, and valuable for the k6 community.

Cloud output v2

Work on a new version of the cloud output has been ongoing over this cycle.

While functionally it is now mostly complete, we feel like more testing is still needed and some smaller issues need to be ironed out.

Over the next cycle we will be testing it internally, and in v0.46.0 it will be generally available as the default Cloud output. It will still be possible to use the current version via an option, but we plan to gradually deprecate it.

The new output has some benefits over the previous one:

  • Binary (protobuf) format instead of JSON #​2963
  • Samples aggregation for every metric instead of only for HTTP ones #​3071
  • HDR Histogram generation for trend-type metrics #​3027

This in general makes the payload sent for tests with a lot of samples much smaller, which also in most cases has turned out to lower the CPU and memory usage.

Other related MRs: #​3041, #​3061, #​3063, #​3072, #​3082, #​3083, #​3085, #​3098, #​3105


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about these updates again.


  • If you want to rebase/retry this MR, check this box

This MR has been generated by Renovate Bot.

Merge request reports