Repository navigation
Todo API pilot: Go, FastAPI and Express as todo backends - #2
Merged
Merged
Conversation
…ss servers - Specify list, create, get, update and delete todos in servers/openapi.json: 400/404 rules, trimmed 1-200 character titles, RFC 3339 timestamps and a 1000-todo cap that drops the oldest - Add servers/conformance.py, a standard-library checker that exercises every rule of the contract against a running server - Implement the API in Go (servers/go/todos.go, concurrency-safe store), FastAPI (hand-parsed bodies so errors are 400, not 422) and Express - Log every rejected request as one JSON line on all three - Run FastAPI as a single uvicorn process so every request sees the same in-memory todos, and update its description in infra/servers.json
- Add bench/k6/src/workload.ts: weighted list, read, create, update, delete and filtered-list requests plus deliberate 400s and 404s - Mark each request's expected statuses so deliberate 4xx and 404s for evicted todos do not count as failures - Name requests by route and drop k6's url system tag so todo ids do not create a series each - Probe each target in setup() and fall back to health checks for servers without the todo API - Use the workload in load.ts, break.ts and match.ts, and describe it on the runner's pages and in bench/README.md
- Group Beyla requests under /api/v1/todos and /api/v1/todos/{id}, written as a quoted JSON array because YAML reads an unquoted {id} as a map and Beyla then crash-loops
- Add a per-route table (rate, 4xx, 5xx, p50, p99 inside the server) and p99 per route and per k6 operation to every server dashboard
- Add a per-route, per-server table to Inside the Servers
- Add a per-operation p99 matrix of the racers to Head to Head
…tch a broken Beyla config - Load each server image after building it, start it, and run servers/conformance.py when it serves the todo API (health check otherwise) - Parse the generated infra/beyla/beyla.yaml as YAML in the checks job, since Beyla has no config check of its own - Fail infra/deploy.sh unless Beyla is running and scraped 15 seconds after the stack is up - Note in infra/README.md that a host without eBPF support now fails the deploy's Beyla check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Every load-test request used to be a health check, so traces were one span named
GET /api/v1/health, logs said nothing, and per-route views had nothing to show. This turns the servers into small todo backends, starting with a pilot of three (one per language family), so traces, logs and dashboards tell a story you can reason about.What changes
servers/openapi.json): list (paging,donefilter), create, get, update, delete. 400 for bad bodies or queries, 404 for missing or non-integer ids,{"error": ...}bodies, trimmed 1-200 character titles, a 1000-todo cap that drops the oldest. In memory, per server.servers/conformance.py, stdlib only): exercises every rule; all three pilot servers pass. CI runs it against every server image that serves the todo API, so the other ten get checked automatically as they are ported.bench/k6/src/workload.ts): 35% list, 25% read, 15% create, 12% update, 5% delete, 3% filtered list, 3% invalid create (400), 2% missing read (404). Expected 4xx count as success, so error rates show only real failures. Requests are named by route and k6'surltag is dropped (no series per todo id). Servers without the todo API automatically get health checks./api/v1/todos/{id}.{id}in Beyla's YAML made it crash-loop locally, and nothing caught it. Now CI parses the generatedbeyla.yaml, anddeploy.shfails unless Beyla is running and scraped.Tested locally (full stack on Docker Engine)
Next
Port the other ten servers the same way once this looks right in production; CI's conformance step enforces the contract on each.