Skip to main content
Back to Blog
Series Playlist

Performance and Observability

Eight guides to k6 scenarios, thresholds, workload models, OpenTelemetry evidence, canaries, capacity, and AI-assisted diagnosis.

Series Chapters (8)

Part 1 · Automation Tutorials

Choose the Right Performance Test: Smoke to Soak

Each performance test type answers one release question and is blind to the rest. This guide runs one k6 v2.3.0 script against a local order API, selecting smoke, average-load, spike-with-recovery, soak and breakpoint scenarios with the new --scenario flag. The runs show a smoke threshold catching a form-encoded body that a bare script reported as exit 0, a spike that passed its threshold yet left latency twice the baseline, a soak whose 75 ms summary hid a 9.5 ms-per-minute climb, and a breakpoint knee eleven seconds before the first error. It ends with a one-page charter tying each run to a release decision.

Oct 20, 202618 min read
Part 2 · Automation Tutorials

Write k6 Thresholds That Fail CI for the Right Reasons

A global p95 and error-rate pair stayed green while every payment took 1.5 seconds longer, because payments were under 3% of requests. This guide rebuilds the gates for a checkout flow with k6 v2.3.0: tagged thresholds tied to stated objectives, latency judged on successful responses, and count floors that catch a misspelt tag, whose thresholds otherwise pass on zero samples. Each gate is proven by an injected regression, and a CI wrapper separates exit code 99 from a broken script.

Oct 21, 202615 min read
Part 3 · Automation Tutorials

Debug k6 Results Without Blaming the Application First

A k6 p95 of 260 ms can come from a service whose own handler p95 is 10 ms. Four k6 v2.3.0 runs against a local stub fake a regression on purpose: JSON parsing on a two-core generator, a 40 Mbit/s link, every virtual user debiting one account, and a file-descriptor limit that reported 80,549 requests a second with 88% failing. Each run shows which signal moves (generator CPU, received bytes, TTFB minus Server-Timing, lock wait) and which stays flat, and a controlled rerun that removed the latency by changing only the generator.

Oct 22, 202620 min read
Part 4 · Automation Tutorials

Model Realistic Workloads with k6 Scenarios

A script that walks every virtual user through browse, search and checkout sends more than three times the real write share at the database. This builds a four-journey k6 v2.3.0 workload, one scenario per journey with its own rate, pool and start time, and checks what the run delivered: printed per-scenario rates that divide by the whole test, a mix that only holds over a shared window, and a slow checkout that starved browse in a weighted single scenario but not in separate ones. It also shows the documented round-robin account pattern colliding on 89% of requests while making latency look faster.

Oct 23, 202616 min read
Part 5 · Automation Tutorials

Connect Load Tests to OpenTelemetry Traces

A failing k6 gate tells you users waited, not where the time went. This wires a k6 v2.3.0 checkout test to OpenTelemetry with three bounded keys (run, journey, phase) carried as tags and W3C baggage, and shows what the tracing library really sends: a new trace per request and a parent span that never arrives. It measures an identifier tag turning 200 requests into 200 series, 10% generator-side sampling keeping traces for 2 of 20 failures, and baggage reaching a stand-in payment provider until it is stripped at egress, then joins one steady-phase failure to its waterfall and logs.

Oct 24, 202619 min read
Part 6 · Automation Tutorials

Test Capacity Limits Before Production Finds Them

A statement API reported zero errors at 110 requests a second while serving 71 and queuing the rest for a database connection, with a 17.5-second p95. This builds a stepped k6 v2.3.0 ramp that tags every request with its load level, reads a per-step table of served rate, pool wait, query time and CPU, and uses Little's Law to explain a plateau 8% below the query-time prediction. It then compares an unbounded pool queue with 503 load shedding, shows evenly spaced arrivals hiding the limit, and confirms the bottleneck by doubling only the pool.

Oct 25, 202618 min read
Part 7 · Automation Tutorials

Use Canary Analysis as a Production Test

A 5% canary failing 0.49% of its requests showed up as 0.025% on the service dashboard, a burn rate of 0.25 that no SLO alert would page on. This guide builds canary analysis as a controlled experiment: a fresh baseline in the same window, stages priced in error budget, and deterministic stop rules with sample floors, tested against four releases in a lab driven by k6 v2.3.0. It then maps the same comparison onto Argo Rollouts v1.10.1 experiments, Flagger and Kayenta, and adds a k6 probe for paths real traffic rarely reaches.

Oct 26, 202618 min read
Part 8 · AI in Testing

Use AI for Performance Diagnosis Without Inventing Causes

Doubling a saturated database pool turned a failing k6 gate green and left the cause running: a slower pricing call made while each request held a connection. This guide builds AI-assisted performance diagnosis as a checked workflow: a sanitised evidence bundle on one clock, a reply contract whose citations code can verify, and one-variable experiments that confirm or reject each hypothesis. In the lab, driven by k6 v2.3.0, a local model's citations matched the cell they named 5 times in 13, and a bundle larger than Ollama's 4,096-token default was silently cut.

Oct 27, 202618 min read