home / testing / k6

k6

Official · Grafana
30k

Load-testing CLI for JavaScript performance tests across HTTP, gRPC, WebSocket, and browser workflows.

$brew install k6
Language
Go
Stars
30,064
Category
Testing & QA
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

k6 is Grafana's load-testing CLI for writing performance tests in JavaScript and running them locally or in Grafana Cloud. It covers API, protocol, and browser journeys while collecting thresholds, summaries, and exportable metrics.

What It Enables
  • Run repeatable load tests for HTTP APIs, gRPC services, WebSockets, and browser flows from versioned JavaScript scripts.
  • Inspect effective options, dependency requirements, and execution requirements before a run, then archive a self-contained test for CI or remote execution.
  • Export summaries and metrics to JSON files or external backends such as OpenTelemetry, Prometheus Remote Write, InfluxDB, and Grafana Cloud.
Agent Fit
  • Core workflows are non-interactive and scriptable, so agents can inspect a test, run it with explicit flags, and gate follow-up actions on thresholds or exported metrics.
  • Machine-readable paths are real: k6 inspect returns JSON, k6 deps --json lists imports and build requirements, --summary-export writes JSON, and -o json streams newline-delimited metrics.
  • Project-level MCP support exists through the separate experimental mcp-k6 server documented by Grafana, but the main k6 binary remains the primary action surface.
Caveats
  • Writing useful tests still requires domain knowledge about traffic shape, thresholds, and environments; k6 measures behavior but does not explain regressions on its own.
  • Browser scenarios and cloud runs add heavier setup, including local browser dependencies or Grafana Cloud authentication.