Update module go.k6.io/k6 to v0.46.0 #297
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.45.1
->v0.46.0
Release Notes
grafana/k6 (go.k6.io/k6)
v0.46.0
Compare Source
k6
v0.46
is here π! This release includes:v1.0.2
, which includes breaking changes.Breaking Changes
Browser
In this release, the xk6-browser extension version is bumped up to
v1.0.2
, as it includes multiple breaking changes concerning options, browser lifecycle, and metrics. See the migration guide for making your test scripts compatible with the new version.Options
devtools
,env
andproxy
are deprecated (browser#868, browser#870, browser#872). Additionally, browserlaunch
/connect
options are no longer defined in the corresponding JS API methods, instead the test execution related options are now defined inside the browser scenario options (see #β3036), and the other more "environmental options", such asheadless
,debug
,executablePath
, are set as ENV vars. Also, theslowMo
option is no longer supported, although it might be supported again in the future through a different API (browser#876).Metrics also went through a few changes. The Web Vitals metrics are renamed to use the
browser_
prefix and short namings (e.g.:webvital_first_input_delay
->browser_web_vital_fid
) (browser#885, browser#903), and the rating metric is removed, as it is now set as a label in the corresponding Web Vitals metrics (browser#915).The browser HTTP metrics have also been modified, as these are now split from the HTTP module ones, so there are new
browser_
prefixed HTTP metrics, specifically for request duration and failed requests (browser#916).Another big change introduced in this version affects the way the browser lifecycle is handled. Users no longer have to explicitly initialize/close the browser instance through the JS API. Instead, a browser instance will be automatically initialized/closed at the beginning/end of each iteration if the browser type is set in scenario options (see #β3036). This also means that the
chromium
entity fromk6/experimental/browser
import path is no longer valid. Instead, thebrowser
entity provides access to the browser methods such asbrowser.newPage()
(browser#910, browser#944). This change means that thebrowser.on()
method is no longer applicable, and therefore it has been removed (browser#919).Additionally, related to import changes, the browser module version is no longer an exported field (browser#923).
Last but not least, this release also includes constraints on browser contexts usage as now only one
browserContext
is allowed per iteration, which means that the user can create a newbrowserContext
, close it, and then create it again; but can not have more than one "live"browserContext
. Instead, scenarios should be used to separate independent actions in a test (browser#929, browser#945).With all these changes, a simple browser test now looks like:
Deprecations
loadimpact/k6
docker image. We recommend switching to thegrafana/k6
image as soon as possible.New features
Loki log output sending additional headers #β3227
k6 has been able to send logs to Loki for nearly 3 years since v0.28.0 but didn't support any way to authenticate.
Now, it can be configured to send additional headers on every request.
This can be done by using the new
header
config option, similar tolabel
:The example above will now send the header
X-My-Header
with the value123
and theAuthorization
header with the valuemytoken
.Thanks to @βfedericotdn for adding this feature.
Cloud Traces #β3100, #β3202
This release supports the new integration between k6 and Tempo in the cloud. Grafana Cloud k6 and Grafana Cloud Tempo customers will be able to start their traces in k6 using the existing
k6/experimental/tracing
module to enrich their test run analysis page with metrics and aggregations from tracing data.The new Cloud traces will work "out of the box" for
k6 cloud
runs. In case ofk6 run
execution, theK6_CLOUD_TRACES_ENABLED
environment variable has to be set totrue
.Ability to configure TLS per gRPC connection #β3159, xk6-grpc#25
The
k6/net/grpc
andk6/experimental/grpc
modules now support configuring TLS per-connection via ConnectParams. This is useful when connecting to a single gRPC server, using different TLS settings for each VUs, as well as when connecting to multiple gRPC servers from the same VU.Expand to see an example of the new functionality.
Thanks @βchrismoran-mica for the contribution πββοΈ.
Cloud Output v2 #β3117
After years of great service, we decided to refresh the k6 Cloud output introducing a more efficient end-to-end solution for ingesting the generated tests' metrics. The main change regards the protocol used for flushing metrics that is now a binary-based payload over HTTP.
The new output reduces the resources a load generator uses for tests that produce many metrics. There is no significant difference in the user experience; it's expected to be the same.
The one thing worth highlighting is that the new output is strict about tags, and it'll drops tags if they are reserved. For example:
test_run_id
, since that is reserved for internal k6 Cloud operations__
), that is marked by Prometheus convention as reservedThis is not yet the default Cloud output for the test runs executed from local machines (
k6 run -o cloud
), but it is expected to be transparently enabled in the upcoming weeks.The full list of related PRs: #β3104, #β3108, #β3120, #β3125, #β3162, #β3169, #β3182, #β3186, #β3187, #β3193, #β3195, #β3206, #β3226, #β3157, #β3172.
UX improvements and enhancements
js/promises
package, which enables extension developers to easily create promises that will be dispatched to the eventloop using theNew
function.RunOnEventLoop
method to themodulestest.Runtime
type, which allows extensions developers to run code on the event loop from their tests.browser_http_req_failed
metric.locator
. Thanks to @βtmc for its implementation.Bug fixes
1.0
when not set by the user.frameNavigated
.pagehide
event evaluation whenpage.close()
is called.browser.close()
panic.Maintenance and internal improvements
K6_INSTANCE_SCENARIOS
environment variable.os.LookupEnv
for k6LookupEnv
and abstracts environment variables lookup.Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.