Skip to content

fix(deps): update module go.k6.io/k6/v2 to v2.2.0 - #233

Open
renovate-sh-app[bot] wants to merge 1 commit into
mainfrom
renovate/go.k6.io-k6-v2-2.x
Open

renovate-sh-app[bot] wants to merge 1 commit into
mainfrom
renovate/go.k6.io-k6-v2-2.x

Conversation

@renovate-sh-app

@renovate-sh-app renovate-sh-app Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
go.k6.io/k6/v2 v2.0.0v2.2.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

grafana/k6 (go.k6.io/k6/v2)

v2.2.0

Compare Source

k6 v2.2.0 is here 🎉! This release includes:

  • k6 cloud run --local-execution now streams k6's logs to Grafana Cloud, so the test run's log view works for local execution too.
  • chromium.connectOverCDP(), which connects browser tests to an already-running Chromium instance.
  • TextEncoder and TextDecoder available as globals, and WritableStream support in k6/experimental/streams.
  • A k6 cloud load-zone list command.
  • Two new experimental feature flags: merge-run-tags and freeze-env.

Breaking changes

There are no breaking changes in this release.

New features

k6 cloud run --local-execution streams logs to Grafana Cloud #​6171

When a cloud test runs locally with k6 cloud run --local-execution, k6's logs now stream to the Grafana Cloud test run, so the run's log view is populated the same way it is for cloud execution. Previously, local-execution logs stayed on the machine running k6 and never reached the cloud. Work with Grafana's secrets management to safely work with secrets and redact them if they're accidentally leaked into logs are pushed. Use the new --no-cloud-logs flag opts out to opt out of streaming of logs when working with --local-execution:

k6 cloud run --local-execution script.js
k6 cloud run --local-execution --no-cloud-logs script.js
Connect to a running browser with chromium.connectOverCDP() #​6165

The browser module can now attach to an existing Chromium-based browser over the Chrome DevTools Protocol, mirroring Playwright's browserType.connectOverCDP(). Pass the browser's WebSocket endpoint and k6 manages the returned browser's connection — it's auto-closed at the end of the iteration, though you can call close() earlier to release the connection on demand.

import { chromium } from 'k6/browser';

export default async function () {
  const browser = await chromium.connectOverCDP('ws://localhost:9222/devtools/browser/<id>');
  const page = await browser.newPage();

  try {
    await page.goto('https://quickpizza.grafana.com/');
  } finally {
    await page.close();
    await browser.close();
  }
}

Unlike the K6_BROWSER_WS_URL environment variable, the endpoint is a runtime value — you can, for example, request a fresh session URL from a browser provider's API in setup() and connect to it from the iterations.

TextEncoder and TextDecoder globals #​6182

TextEncoder and TextDecoder are now available as standard globals in both the init and VU contexts, no import required — matching how they are exposed in browsers and other JavaScript runtimes.

const encoded = new TextEncoder().encode('Hello, world!');
const decoded = new TextDecoder().decode(encoded);
WritableStream in k6/experimental/streams #​6132

The experimental streams module now implements WritableStream and WritableStreamDefaultWriter following the WHATWG Streams specification, complementing the existing ReadableStream and paving the way for a future TransformStream implementation.

import { WritableStream } from 'k6/experimental/streams';

export default async function () {
  const stream = new WritableStream({
    write(chunk) {
      console.log(`wrote ${chunk}`);
    },
  });

  const writer = stream.getWriter();
  await writer.write('hello');
  await writer.close();
}
k6 cloud load-zone list command #​6142

A new k6 cloud load-zone list subcommand lists the load zones — public and private — available in the configured Grafana Cloud k6 stack, mirroring the existing k6 cloud project list command. Output defaults to a human-readable table; pass --json to emit a JSON array instead.

$ k6 cloud load-zone list
Load zones for https://example.grafana.net:

ID                     NAME                     TYPE      AVAILABLE
amazon:us:ashburn      Ashburn, US (Amazon)     public    yes
amazon:sa:cape town    Cape Town, SA (Amazon)   public    yes
Configurable handleSummary() timeout #​5854

The time budget for the handleSummary() callback — previously hardcoded to 120 seconds — is now configurable through the handleSummaryTimeout option or the K6_HANDLE_SUMMARY_TIMEOUT environment variable, so long-running tests with heavy summaries no longer fail with handleSummary() execution timed out. Thanks, @​LBaronceli!

export const options = {
  handleSummaryTimeout: '5m',
};
New experimental feature flags: merge-run-tags and freeze-env

Two new experimental flags join the feature-flag system introduced in v2.1.0:

  • #​5714 merge-run-tags merges run tags per key across config layers, so options.tags in a script is no longer silently discarded when --tag or K6_TAGS is also used — higher-priority layers win on conflicting keys instead of replacing the whole map. Thanks, @​yordis!
  • #​6032 freeze-env freezes the __ENV object, so modifications from script code throw a TypeError (in strict mode) instead of silently persisting across iterations and scenarios. Thanks, @​lohitkolluri!
k6 run --features merge-run-tags,freeze-env script.js

UX improvements and enhancements

  • #​5631 Makes the browser module's header accessors — response.allHeaders(), headerValue(), headerValues(), and headersArray() — return the raw wire headers (including Set-Cookie and security-related headers), correctly paired with each hop of a redirect chain instead of Chrome's provisional headers. As part of this, headerValues() now matches header names case-insensitively and splits repeated values on newlines rather than commas, and the browser_data_sent/browser_data_received metrics now include the raw header bytes and no longer vary run-to-run with CDP event ordering.
  • #​6208 Makes k6 cloud reject the run flags (for example, --vus) with an unknown flag error and a non-zero exit code. Previously k6 cloud --vus 10 script.js accepted the flags, printed the help text, and exited 0 — running tests with k6 cloud directly was deprecated in v2.0.0 in favor of k6 cloud run.
  • #​6096 Points the cloud secrets error at K6_CLOUD_SECRETS_TOKEN and K6_CLOUD_SECRETS_ENDPOINT when a test run is reused via K6_CLOUD_PUSH_REF_ID under --local-execution, instead of suggesting the --local-execution flag the user is already using.
  • #​6196 Adds catch blocks to the browser examples so a failing iteration reports the original error instead of a subsequent page.close() failure. Thanks, @​locker95!

Bug fixes

  • #​6234 Classifies HTTP/2 errors by message so the error_code metric tag stays correct when k6 is built with Go 1.27 (whose x/net/http2 delegates to the standard library), and explicitly enables HTTP/2 negotiation on VU transports.
  • #​6232 Drains queued log entries in the Loki hook at shutdown so --out loki and cloud log streaming no longer lose the final batch, and emits a k6 dropped N log messages warning when the cloud log buffer overflows instead of dropping logs silently.
  • #​6125 Serializes the first concurrent open of a file in the caching filesystem so parallel fs.open() calls on the same file no longer read zero or truncated bytes.
  • #​6147 Fixes a data race and inconsistent request-interception state when browser routes are added or removed concurrently. Thanks, @​somak2kai!
  • #​6070 Flushes buffered file log output once per second so recent logs aren't lost when k6 is killed before shutdown. Thanks, @​rohan-patnaik!
  • #​6205 Stops sending an invalid Sec-WebSocket-Protocol header when tailing Grafana Cloud logs; spec-strict servers rejected the handshake with websocket: bad handshake.
  • #​6200 Leaves a counter's rate unset when the observed duration is zero, instead of computing +Inf and spuriously failing rate thresholds. Thanks, @​samarth70!
  • #​6195 Initializes a gauge's maximum from the first sample so all-negative gauge series no longer report max=0. Thanks, @​Solaris-star!
  • #​6145 Prevents the OpenTelemetry output from panicking at startup when basic auth is configured without K6_OTEL_HEADERS. Thanks, @​lukdz!
  • #​6140 Stops SharedArray deep-freezing JS primitives, which needlessly wrapped large strings in String objects — cutting memory usage in the reported reproduction from roughly 1 GB to 100 MB.

Maintenance and internal improvements

  • #​6126, #​6224, #​6229 Adds anonymous extension usage to the k6 usage report: a run reports the Go module path, version, and type of registry-cataloged extensions it actually uses (imported k6/x/ modules, output extensions selected with --out, and k6 x subcommands). Private and unlisted extensions are never reported, and the existing --no-usage-report opt-out covers it.
  • #​6183, #​6218 Updates Sobek and regexp2, making WeakMap/WeakSet entries garbage-collectable, improving string and typed-array correctness and performance, and bounding regular-expression backtracking memory.
  • #​6169, #​6230 Migrates k6 cloud run --local-execution from the legacy v1 cloud API to the v6 and provisioning APIs, and quietens its status polling logs. User-facing behavior is unchanged, and k6 run --out cloud stays on the legacy API.
  • #​6170 Lets an orchestration service that provisioned a test run itself supply the scoped push credentials to k6 cloud run --local-execution via the K6_CLOUD_METRICS_PUSH_URL and K6_CLOUD_TEST_RUN_TOKEN environment variables.
  • #​6151, #​6152, #​6173 Updates github.com/grafana/k6-cloud-openapi-client-go, consuming the upstream retry body-reset fix (dropping the k6-side workaround) and the int64 resource-ID widening.
  • #​6149, #​6159 Cleans up the internal cloud API clients, removing the dead v6 config file and sharing the 401/403 error classification between the v1 and v6 clients.
  • #​6144 Retains and calls the regular-duration context cancel function in executors instead of discarding it. Thanks, @​the-onewho-knocks!
  • #​6141 Adds unit tests for the browser mouse options. Thanks, @​hyuraku!
  • #​6129 Fixes documentation typos. Thanks, @​Martonveghcode!
  • #​6203 Fixes the xk6 CI job for fork PRs after the go.k6.io/k6/v2 module move.
  • #​6112 Centralizes the CI Go versions into .github/go-versions.env.
  • #​6104 Skips the code CI jobs for docs-only and release-notes-only PRs.
  • #​6103 Adds the feature brief process to the contributing docs.
  • #​6075 Prepares the workflows for get-vault-secrets v2.
  • #​6134 Updates the Go toolchain directive to 1.25.12 [security].
  • #​6191, #​6192, #​6240 Updates google.golang.org/grpc to v1.83.0 [security].
  • #​6185, #​6186 Updates golang.org/x/net to v0.56.0 and golang.org/x/text to v0.39.0 in the gRPC server example [security].
  • #​6097, #​6212, #​6156, #​6213, #​6176, #​6214, #​6083, #​6177, #​6239, #​6216, #​6215, #​6175, #​6174, #​6082 Updates Go dependencies, including the golang.org/x packages, klauspost/compress, mattn/go-isatty, mccutchen/go-httpbin, the OpenTelemetry and Prometheus protobufs, andybalholm/brotli, and evanw/esbuild.
  • #​6155, #​6080, #​6098, #​6114 Updates the Docker base images (Go to 1.26.5, Alpine to 3.24.1, Debian to trixie-20260623).
  • #​6158, #​6119, #​6120, #​6121, #​6122, #​6076, #​6123, #​6124 Updates the GitHub Actions dependencies, including actions/checkout to v7, golangci/golangci-lint-action to v9.3.0, and the grafana/shared-workflows actions.

External contributors

A huge thank you to the external contributors who helped during this release: @​LBaronceli, @​yordis, @​lohitkolluri, @​locker95, @​rohan-patnaik, @​somak2kai, @​samarth70, @​Solaris-star, @​lukdz, @​the-onewho-knocks, @​hyuraku, and @​Martonveghcode! 🙏

v2.1.0

Compare Source

k6 v2.1.0 is here 🎉

This release includes:

  • An opt-in feature-flag system — --features, the K6_FEATURES environment variable, and a k6 features discovery command — shipping with experimental native histograms for trend metrics as its first flag.
  • A context-level proxy option for browser contexts.
  • Subcommand discovery in k6 x, so binaries can report which extension commands they expose.

Breaking changes

There are no breaking changes in this release.

New features

k6 cloud test list command #​6007

A new k6 cloud test command group has been added, with a k6 cloud test list subcommand that lists the load tests of a Grafana Cloud k6 project. It complements the k6 cloud project list command introduced in v2.0.0.

The project to list tests for is resolved in the following order:

  1. The --project-id flag.
  2. The K6_CLOUD_PROJECT_ID environment variable (cloud config projectID).
  3. The default project of the configured stack, populated by k6 cloud login.

Output defaults to a human-readable table. Pass --json to emit a JSON array instead, mirroring the format established by k6 cloud project list.

k6 cloud test list
k6 cloud test list --project-id 12345
k6 cloud test list --json
Feature flags and experimental native histograms #​6055, #​6056

k6 now has an opt-in feature-flag mechanism for trialing new, not-yet-stable behavior without affecting existing runs. Flags can be enabled on k6 run and k6 cloud run through the --features flag (comma-separated or repeated), the K6_FEATURES environment variable, or the features key in config.json. Enabled flags are surfaced as metric tags and propagated into archives and cloud workers so a run behaves consistently wherever it executes.

Use k6 features (or k6 features --json) to discover the available flags and their lifecycle:

$ k6 features
FEATURE             LIFECYCLE      DESCRIPTION
native-histograms   Experimental   Use native histograms for trend metrics

The first flag shipped is native-histograms, an experimental flag that makes k6 use native histograms for trend metrics:

k6 run --features native-histograms script.js

# or
K6_FEATURES=native-histograms k6 run script.js
Subcommand discovery in k6 x #​5972

Running k6 x now lists the available subcommands — both the ones baked into the binary and those advertised by the extension registry (official and community). Tab-completion surfaces the same set once the catalog has been cached locally by a prior k6 x run, so completion never blocks on the network.

$ k6 x
...
Available Commands:
  agent       Bootstrap an AI-assisted k6 testing workflow in any editor
  docs        CLI k6 docs for AI agents and users
  explore     Explore k6 extensions for Automatic Resolution
  mcp         An MCP server for k6 for AI agents

This makes a k6 binary self-describing — particularly useful for AI agents driving k6, which previously had no way to introspect which extension subcommands were available.

Browser context proxy option #​5924

Browser contexts can now be configured with a context-level proxy option, letting you route a context's traffic through a proxy without launching a custom-built binary or relying on environment proxy variables (which only affected k6's DevTools WebSocket connection). The option is wired to Chromium through Target.createBrowserContext, and invalid proxy configuration now fails early when proxy.server is missing. Thanks, @​nightt5879!

const context = await browser.newContext({
  proxy: {
    server: 'http://proxy.test:8080',
    bypass: 'localhost,127.0.0.1',
  },
});
Browser locator.isInViewport() #​6023

A new locator.isInViewport() method reports whether an element intersects the browser viewport. It accepts an optional ratio (0 to 1) that sets how much of the element must be visible, defaulting to 0 so any visible pixel counts, matching Playwright's toBeInViewport semantics. The call waits for the element to attach, honoring the timeout option, then measures the intersection once. Thanks, @​Anuragp22!

const button = page.locator('button#submit');
if (await button.isInViewport()) {
  await button.click();
}
Basic auth for the OpenTelemetry HTTP exporter #​5997

The OpenTelemetry output's HTTP exporter can now send HTTP Basic Auth credentials. Set them through the K6_OTEL_HTTP_EXPORTER_USERNAME and K6_OTEL_HTTP_EXPORTER_PASSWORD environment variables, or the username and password keys in the output config.

K6_OTEL_HTTP_EXPORTER_USERNAME=user \
K6_OTEL_HTTP_EXPORTER_PASSWORD=secret \
k6 run --out opentelemetry script.js
single() selection helper in k6/html #​6002

Selection.single(selector) returns at most one matching element, backed by goquery's Single matcher for a faster lookup than find() when you only need the first match. Thanks, @​rohan-patnaik!

import { parseHTML } from 'k6/html';

const doc = parseHTML(content);
const title = doc.single('h1').text();

UX improvements and enhancements

  • #​5971 Tags browser API failures with module=browser so that browser errors surfaced in Grafana Cloud Logs can be filtered separately from other log sources.

Bug fixes

  • #​5794 Makes the --vus flag work as a standalone execution shortcut instead of being silently ignored when a script defines scenarios. Running k6 run script.js --vus N now creates a shared-iterations scenario with N VUs and N iterations, overriding any script-defined scenarios with a warning — consistent with how --iterations, --duration, and --stages already behave. Thanks, @​Reranko05!
  • #​6013 Rejects invalid threshold percentiles. A percentile aggregation value outside the 0 to 100 range (or NaN) now fails parsing with a clear message instead of being silently accepted. Thanks, @​immanuwell!
  • #​6011 Writes the on-disk k6 config file with owner-only permissions (0o600, inside a 0o700 directory). The file can hold the Grafana Cloud API token (collectors.cloud.token), so tightening it keeps other local users on shared hosts (CI runners, multi-user boxes, sidecar containers) from reading the token. Existing configs are upgraded on the next write, for example the next k6 cloud login.

Maintenance and internal improvements

  • #​6033 Moves Docker Hub image publishing to a Google Artifact Registry mirror.
  • #​5953 Installs s3cmd via apt instead of pip to fix the k6packager image build.
  • #​6052 Fixes the browser end-to-end test workflow.
  • #​5984 Routes per-test logger output to the test instance instead of the global logrus, improving test isolation.
  • #​5985 Fixes the flaky TestPageScreenshotFullpage browser test.
  • #​5981 Lets Renovate track the Go minor version in the setup-go workflows.
  • #​5968 Honors the caller-pinned ref in the shared lint action.
  • #​6041, #​6054 Aligns the Go module directive and toolchain (1.25.0 / 1.25.11).
  • #​5967 Updates the release notes template after v2.0.0.
  • #​6015 Updates golang.org/x/net to v0.55.0 [security].
  • #​6026 Updates golang.org/x/crypto to v0.52.0 [security].
  • #​5962, #​6028 Updates google.golang.org/grpc to v1.81.1.
  • #​5960 Updates grafana/shared-workflows/get-vault-secrets to v1.3.2.
  • #​5958 Updates grafana/shared-workflows/azure-trusted-signing to v1.0.2.
  • #​5957 Updates github/codeql-action to v4.35.4.
  • #​5959 Updates grafana/shared-workflows/dockerhub-login to v1.0.4.
  • #​6009 Moves the browser PageScreenshotOptions parsing into the mapping layer.
  • #​5964 Adds the k6 feature-flags specification under openspec/.
  • #​6067 Forces the legacy x/net/http2 implementation on the gotip CI test job.
  • #​6065 Lets Renovate update the Dockerfile on the v1.x branch.
  • #​6031 Updates go.opentelemetry.io/otel to v1.44.0.
  • #​6086 Updates golang.org/x dependencies (crypto to v0.53.0, net to v0.56.0, term to v0.44.0).
  • #​6061 Updates golang.org/x/sync to v0.21.0.
  • #​6030 Updates github.com/tidwall/gjson to v1.19.0.
  • #​6029 Updates github.com/mccutchen/go-httpbin/v2 to v2.23.0.
  • #​6063 Updates github.com/mattn/go-colorable to v0.1.15.
  • #​6062 Updates the Golang Docker image to 1.26.4.
  • #​6084 Updates the Alpine Docker image to 3.24.0.
  • #​6027 Updates the Debian Docker image to trixie-20260518.

External contributors

A huge thank you to the external contributors who helped during this release: @​nightt5879, @​Reranko05, @​rohan-patnaik, @​immanuwell, and @​Anuragp22! 🙏


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, on day 1 of the month (* 0-3 1 * *)
  • 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.


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

Need help?

You can ask for more help in the following Slack channel: #proj-renovate-self-hosted. In that channel you can also find ADR and FAQ docs in the Resources section.

@renovate-sh-app

renovate-sh-app Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 22 additional dependencies were updated

Details:

Package Change
github.com/grafana/sobek v0.0.0-20260429085637-a66d4790012b -> v0.0.0-20260727154728-7781506a890f
github.com/evanw/esbuild v0.28.0 -> v0.28.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 -> v2.29.0
github.com/klauspost/compress v1.18.6 -> v1.19.1
github.com/mattn/go-colorable v0.1.14 -> v0.1.15
github.com/mattn/go-isatty v0.0.22 -> v0.0.24
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.43.0 -> v1.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.43.0 -> v1.44.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.43.0 -> v1.44.0
go.opentelemetry.io/proto/otlp v1.10.0 -> v1.11.0
golang.org/x/crypto v0.52.0 -> v0.54.0
golang.org/x/mod v0.35.0 -> v0.37.0
golang.org/x/net v0.55.0 -> v0.57.0
golang.org/x/sync v0.20.0 -> v0.22.0
golang.org/x/sys v0.45.0 -> v0.47.0
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa -> v0.0.0-20260625142307-59b4966ccb57
golang.org/x/term v0.43.0 -> v0.45.0
golang.org/x/text v0.37.0 -> v0.40.0
golang.org/x/tools v0.44.0 -> v0.47.0
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 -> v0.0.0-20260720211330-0afa2a65878a
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa -> v0.0.0-20260720211330-0afa2a65878a
google.golang.org/grpc v1.81.1 -> v1.83.0

| datasource | package        | from   | to     |
| ---------- | -------------- | ------ | ------ |
| go         | go.k6.io/k6/v2 | v2.0.0 | v2.2.0 |


Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
@renovate-sh-app
renovate-sh-app Bot force-pushed the renovate/go.k6.io-k6-v2-2.x branch from 2b52dc3 to ed9e5cc Compare August 13, 2026 15:02
@renovate-sh-app renovate-sh-app Bot changed the title fix(deps): update module go.k6.io/k6/v2 to v2.1.0 fix(deps): update module go.k6.io/k6/v2 to v2.2.0 Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants