Skip to content

httpext: keep a named request's URL in sample metadata - #1

Merged
jgaalen merged 1 commit into
Breaking-IT:masterfrom
DanielPerfana:breakingit-request-url-metadata
Nov 6, 2026
Merged

jgaalen merged 1 commit into
Breaking-IT:masterfrom
DanielPerfana:breakingit-request-url-metadata

Conversation

@DanielPerfana

Copy link
Copy Markdown

What?

Adds an opt-in httpRequestUrl option (K6_HTTP_REQUEST_URL). When enabled and a request has a manually set name tag, the real request URL is stored in the sample metadata under request_url (httpext.MetadataRequestURL).

Default off; nothing changes unless the option is set.

Why?

A name tag overwrites the request's url tag with the name, to keep the number of distinct values in the indexed tags low. That loses the URL the request actually hit: nothing else in the metric stream carries it, so an output cannot report it. Metadata is not indexed, so the URL can be kept there without bringing back the high-cardinality cost.

The perfana-k6-timescaledb output reads request_url to fill its URL columns for named requests.

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 (lib/netext/httpext/transport_test.go).
  • I have run linter and tests locally (make check) and all pass. Ran go test for ./lib/..., ./internal/js/modules/k6/execution/... and TestExecutionTestOptionsDefaultValues in ./internal/cmd/tests/, plus go vet on the changed packages; all pass. Did not run the full make check.

Also adds a line for the option to the fork-specific changes list in FORK.md.

🤖 Generated with Claude Code

Setting a `name` tag on a request overwrites its `url` tag with the name, to
avoid high-cardinality URLs in the indexed tags. That loses the URL the request
actually hit; nothing else in the metric stream carries it.

Add the opt-in `httpRequestUrl` option (K6_HTTP_REQUEST_URL). When enabled,
the real URL is stored in the sample metadata under `request_url`, which is
not indexed, so outputs can report it without the cardinality cost. Default
off; behaviour is unchanged unless enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jgaalen
jgaalen changed the base branch from breakingit to master November 6, 2026 06:37
@jgaalen
jgaalen merged commit b8f02d8 into Breaking-IT:master Nov 6, 2026
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