revert(load-generator): replace k6 with Locust - #3873
Conversation
Reverts open-telemetry#3564. Restores the pre-k6 Locust-based load generator (locustfile.py, requirements, Envoy /loadgen/ route, compose service config) while keeping everything unrelated added since that commit. This reverts commit 18b36c7. Assisted-by: Claude Sonnet 5
There was a problem hiding this comment.
Pull request overview
Restores the Locust-based load generator and removes the k6 implementation.
Changes:
- Restores Locust, Playwright browser traffic, Python dependencies, and container configuration.
- Restores the Locust UI route, environment settings, and documentation links.
- Removes k6-specific code, flags, dependencies, and changelog entries.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.env |
Restores Locust environment settings. |
.github/dependabot.yml |
Switches load-generator updates to pip. |
CHANGELOG.md |
Removes k6 feature entries. |
CONTRIBUTING.md |
Restores the Locust UI link. |
Makefile |
Prints the Locust UI URL. |
compose.yaml |
Restores Locust deployment configuration. |
src/flagd/demo.flagd.json |
Removes k6 load-control flags. |
src/frontend-proxy/envoy.tmpl.yaml |
Restores the /loadgen/ route. |
src/load-generator/Dockerfile |
Restores the Python/Locust image. |
src/load-generator/README.md |
Restores Locust usage documentation. |
src/load-generator/entrypoint.sh |
Removes the k6 wrapper. |
src/load-generator/locustfile.py |
Restores HTTP and browser workloads. |
src/load-generator/requirements.in |
Defines direct Python dependencies. |
src/load-generator/requirements.txt |
Locks Python dependencies. |
src/load-generator/script.js |
Removes the k6 workload. |
src/load-generator/xk6-otel/go.mod |
Removes the extension module definition. |
src/load-generator/xk6-otel/go.sum |
Removes extension dependency checksums. |
src/load-generator/xk6-otel/otel.go |
Removes the custom k6 OTel extension. |
src/otel-collector/otelcol-config.yml |
Reverts collector CORS headers. |
test/telemetry/services.py |
Updates the frontend-web exclusion rationale. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- otel-collector: restore allowed_headers (content-type, traceparent, baggage) on the OTLP HTTP receiver's CORS config, otherwise the browser's baggage-bearing preflight requests are rejected and frontend-web telemetry disappears. - locustfile.py: register the RoofBinoculars response listener before navigating instead of after, so a fast image response isn't missed. - demo.flagd.json: restore loadGeneratorTraffic and loadGeneratorVUs, which the flagd-ui scheduler tests still assert exist. - services.py: correct the frontend-web exclusion comment; browser traffic is enabled in every scope, it's just low-weighted relative to HTTP traffic, not disabled. - README.md: point to the stable Locust docs instead of the 2.16 archive, since the restored lockfile pins 2.44.4. Assisted-by: Claude Sonnet 5
|
When testing this PR I'm failing to build flagd-ui. |
loadGeneratorTraffic rests at "on" and loadGeneratorVUs rests at its own default variant, not "off". With the fixed seed used by these tests, the scheduler deterministically picked one of them, so the generic "reverts to off" assertions never passed. Restrict those tests to off-resting flags, matching the pattern already used elsewhere in this file. Assisted-by: Claude Sonnet 5
|
Thanks for catching that! The 3 failing tests (variant_of(flag) == "off" assertions in scheduler_test.exs:165,245,367) were assuming every flag rests at "off" after a revert, but loadGeneratorTraffic and loadGeneratorVUs don't — they're covered by their own revert tests instead. Fixed in b98d030 by excluding those two from the generic off-resting assertions. Rebuilt the flagd-ui test stage locally and confirmed 50/50 tests pass now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.
Suppressed comments (2)
src/flagd/demo.flagd.json:128
- This flag is now disconnected from concurrency control. The deleted wrapper consumed
loadGeneratorVUs, but the restored service starts Locust with the staticLOCUST_USERSenvironment value and no code observes this flag. Remove the stale flag and its flagd-ui coverage/docs, or wire it to Locust's runner so changing it actually resizes users.
"loadGeneratorVUs": {
"description": "Number of concurrent virtual users the load generator's HTTP scenario runs.",
src/load-generator/locustfile.py:137
- This second product span also uses the unregistered
product.idkey. Rename it to the existingdemo.product.idattribute and add that attribute to the load-generator service declaration in the telemetry registry.
with self.tracer.start_as_current_span("user_get_recommendations", context=context.get_current(), attributes={"product.id": product}):
|
@mwimpelberg28 I think copilot found some inconsistencies with attributes naming. |
loadGeneratorTraffic and loadGeneratorVUs were introduced by the k6 migration (open-telemetry#3564) and consumed only by its entrypoint.sh wrapper; the restored Locust code never observed them. Remove both flags along with the flagd-ui scheduler test cases and README section that existed only to accommodate their non-off resting state, restoring the pre-k6 flag set. Assisted-by: Claude Sonnet 5
Replace unregistered span attributes (product.id, quantity, category, item.count, flood.count) with their existing demo.* registry equivalents, adding a new demo.request.flood.count attribute for the one case with no existing match, and declare all of them for service.load_generator per the telemetry-schema conventions. Assisted-by: Claude Sonnet 5
Good catch, I fixed those and the checks are passing now. |
- Restore the open-telemetry#3564 changelog bullets under 3.0.0, which was already released with them, and add a new Unreleased entry for this revert instead of rewriting released history. - Fix the service.load_generator attribute group: its brief claimed "baggage attributes" but most of its members are plain span attributes, and it was missing user.id, which locustfile.py also emits as a span attribute. Assisted-by: Claude Sonnet 5
|
@mwimpelberg28, we potentially keep k6 as a replacement, but it requires Grafana to re-license package from AGPL to something more permissive, the best option from OTel/CNCF persective is Apache 2.0. It is not a blocking comment, just highlighting possibility on the table. I suppose this change is extremely unlikely based on the historical Grafanas' decisions. |
Can an exception be granted in the AGPL just for the demo app? |
Unfortunately no, see cncf/foundation#1482 |
|
@mwimpelberg28 would you be able to take care of the docs revert as well? |
Reverts #3564. Restores the pre-k6 Locust-based load generator (locustfile.py, requirements, Envoy /loadgen/ route, compose service config) while keeping everything unrelated added since that commit.
This reverts commit 18b36c7.
Assisted-by: Claude Sonnet 5
Changes
Please provide a brief description of the changes here.
Merge Requirements
For new features contributions, please make sure you have completed the following
essential items:
CHANGELOG.mdupdated to document new feature additionsMaintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.