Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.45.0 release notes #3115

Merged
merged 18 commits into from
Jun 19, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions release notes/v0.45.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
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

* [#3066](https://github.com/grafana/k6/pull/3066) k6 will warn users about metric names incompatible with OpenTelemetry or Prometheus. This is planned to become an error with v0.48.0.
olegbespalov marked this conversation as resolved.
Show resolved Hide resolved
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

mstoykov marked this conversation as resolved.
Show resolved Hide resolved
## New features

### Experimental gRPC module with streaming support [#3107](https://github.com/grafana/k6/pull/3107)

There is a new experimental module `k6/experimental/grpc`. It is a copy of the `k6/grpc` module with added stream support [#2020](https://github.com/grafana/k6/issues/2020).
mstoykov marked this conversation as resolved.
Show resolved Hide resolved


<details>
<summary> Expand to see an example of the new functionality.</summary>

This example shows server streaming:

```javascript
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_PROTO_PATH = __ENV.GRPC_PROTO_PATH || '../../grpc_server/route_guide.proto';

let client = new Client();

client.load([], GRPC_PROTO_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);
};
```
</details>

You can just replace `k6/grpc` import with `k6/experimental/grpc` to use the new functionality.

In the future this functionality will be moved to the `k6/grpc` module.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

### You can now only upload a test to the cloud without running it [#3030](https://github.com/grafana/k6/pull/3030)

For [years users have wanted](https://github.com/grafana/k6-cloud-feature-requests/issues/22) 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-verson-of-script.js` on "release".
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

And later on that newer version will be used. For example by a [scheduled run](https://k6.io/docs/cloud/manage/scheduled-tests/).

### Setting sample metadata API [#3037](https://github.com/grafana/k6/pull/3037)

It is now possible to set metadata for samples emitted by a given VU.

Metadata was added in v0.41.0 but was not available to be set from JS code. This was mainly due to lack of agreement on the API to do so.

After further discussion, a compromised, smaller and consistent API was agreed upon.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

The API is similar to the one used to set tags for all metrics of the VU:
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
```javascript
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 metriccs from here on wil *not* have the metadata set
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
}
```

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

- [#3015](https://github.com/grafana/k6/pull/3015) Official arm64 docker images. Thanks to @nrxr! 🙇
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
- [#3099](https://github.com/grafana/k6/pull/3099) replace "breached" with "crossed" in logs around thresholds. Thanks to @MattDodsonEnglish 🙇.
- [#3102](https://github.com/grafana/k6/pull/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](https://github.com/grafana/k6/pull/3089) Add Software Bill of Materials (SBOM) reports to k6 releases. Thanks to @SadFaceSmith 🙇.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

## Bug fixes

* [#3058](https://github.com/grafana/k6/pull/3058) fix repetitive `the`. Thank you, @cuishuang 🙇.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

mstoykov marked this conversation as resolved.
Show resolved Hide resolved
## Maintenance and internal improvements

- [#2091](https://github.com/grafana/k6/pull/2991) Refactor JS modules system so that is usable in tests. Which allowed the enablement of the tc39 tests for modules [#3040](https://github.com/grafana/k6/pull/3040).
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
- [#3025](https://github.com/grafana/k6/pull/3025) Internally stop referring to afero and use an internal package to do all file system interaction. That package still uses afero.
- [#3036](https://github.com/grafana/k6/pull/3036) and [#3053](https://github.com/grafana/k6/pull/3053) Add options to `scenarios` for usage by browser module.
- [#3064](https://github.com/grafana/k6/pull/3064), [#3070](https://github.com/grafana/k6/pull/3070), [#3075](https://github.com/grafana/k6/pull/3075) and [#3106](https://github.com/grafana/k6/pull/3106) Go dependancies updates.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
- [#3067](https://github.com/grafana/k6/pull/3067) Add method to retrive all registered metrics.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
- [#3068](https://github.com/grafana/k6/pull/3068) Add metric Sink constructor.
- [#3078](https://github.com/grafana/k6/pull/3078) Pinning to Alpine 3.17 in Docker builder image. Thank you, @arukiidou 🙇.
mstoykov marked this conversation as resolved.
Show resolved Hide resolved
- [#3086](https://github.com/grafana/k6/pull/3086) Fix downloading `.golangci.yml` for PRs from forks.
- [#3088](https://github.com/grafana/k6/pull/3088) Make TestDNSResolver less flaky.
- [#3094](https://github.com/grafana/k6/pull/3094) Fix example from the run command. Thanks to @rocktwotj 🙇.
- [#3095](https://github.com/grafana/k6/pull/3095) Maintenance update of `.golangci.yml`.
- [#3103](https://github.com/grafana/k6/pull/3103) Fix lint and logical issues in `k6/data` module tests.
- [#3045](https://github.com/grafana/k6/pull/3045), [#3049](https://github.com/grafana/k6/pull/3049), [#3073](https://github.com/grafana/k6/pull/3073) and [#3044](https://github.com/grafana/k6/pull/3044) New issues are now automatically assigned to maintainers, to improve response time on issues. Both new issue and new PR assignments are now not using external actions.
- [#3109](https://github.com/grafana/k6/pull/3109) Add a way to get the cloudapi Client's base URL. Thanks to @yorugac 🙇.
## Roadmap
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

There is now a [public Roadmap document](https://github.com/grafana/k6/blob/master/ROADMAP.md) in the main repo added in [#3028](https://github.com/grafana/k6/pull/3028)
olegbespalov marked this conversation as resolved.
Show resolved Hide resolved
mstoykov marked this conversation as resolved.
Show resolved Hide resolved

The idea is that we will keep it updated and current or future users will be able to look at it to see on what bigger projects the team is working on.

### Cloud output v2
TODO
codebien marked this conversation as resolved.
Show resolved Hide resolved
- https://github.com/grafana/k6/pull/2963
- https://github.com/grafana/k6/pull/3027
- https://github.com/grafana/k6/pull/3041
- https://github.com/grafana/k6/pull/3061
- https://github.com/grafana/k6/pull/3063
- https://github.com/grafana/k6/pull/3071
- https://github.com/grafana/k6/pull/3072
- https://github.com/grafana/k6/pull/3082
- https://github.com/grafana/k6/pull/3083
- https://github.com/grafana/k6/pull/3085
- https://github.com/grafana/k6/pull/3098
- https://github.com/grafana/k6/pull/3105
_Placeholder_