Skip to content

Backport #5845 to v1.x: Wire k6provider structured logging into k6 - #5995

Merged
mstoykov merged 2 commits into
v1.xfrom
backport-5845-k6provider-structured-logging
May 18, 2026
Merged

Backport #5845 to v1.x: Wire k6provider structured logging into k6#5995
mstoykov merged 2 commits into
v1.xfrom
backport-5845-k6provider-structured-logging

Conversation

@mstoykov

Copy link
Copy Markdown
Contributor

What?

Backport of #5845 to the v1.x branch for the v1.8.0 release.

Adds a slog.Handler bridge (logrusSlogHandler) that forwards k6provider's
structured log events through k6's existing logrus logger, so provider
operations (artifact resolution, cache hits, downloads, retries, pruning)
appear in k6's log output at the correct level.

Removes the now-redundant manual provisioning Info log from
k6buildProvisioner.provision.

Split into two commits for clarity / bisect-safety:

  1. chore(deps): bump k6provider to v0.5.0 and drop vendored k6build — needed for NewProviderWithLogger (introduced in v0.4.0; v0.5.0 picked to match the version already in flight on the v1.8.0 line). The k6provider release absorbs the error types previously in github.com/grafana/k6build, so that vendored package is dropped.
  2. Wire k6provider structured logging into k6 (#5845) — the actual backport change.

Why?

So users running the v1.8.0 line see provider operations
(resolution / cache / download / retry / prune) in their k6 log output,
at the correct level, instead of a single hard-coded post-hoc Info line.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

@mstoykov
mstoykov requested a review from a team as a code owner May 15, 2026 10:41
@mstoykov mstoykov added this to the v1.8.0 milestone May 15, 2026
@mstoykov
mstoykov requested review from inancgumus and oleiade and removed request for a team May 15, 2026 10:41
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 10:46 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 10:48 — with GitHub Actions Inactive

@inancgumus inancgumus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts.

mstoykov added 2 commits May 15, 2026 23:33
Bumps github.com/grafana/k6provider from v0.2.0 to v0.5.0 (needed for
NewProviderWithLogger, introduced in v0.4.0). The k6provider release
absorbs the error types that used to live in github.com/grafana/k6build,
so the vendored k6build package is no longer referenced and is dropped.
Adds a slog.Handler bridge (logrusSlogHandler) that forwards k6provider's
structured log events through k6's existing logrus logger, so provider
operations (artifact resolution, cache hits, downloads, retries, pruning)
appear in k6's log output at the correct level.

Removes the now-redundant manual provisioning Info log from
k6buildProvisioner.provision.

Backport of #5845.
@mstoykov
mstoykov force-pushed the backport-5845-k6provider-structured-logging branch from e73ea2c to b2085fd Compare May 15, 2026 20:34
@mstoykov
mstoykov requested a review from inancgumus May 15, 2026 20:35
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 20:41 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 20:43 — with GitHub Actions Inactive
@mstoykov
mstoykov merged commit 9a94e41 into v1.x May 18, 2026
49 checks passed
@mstoykov
mstoykov deleted the backport-5845-k6provider-structured-logging branch May 18, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants