Grafana k6
$ k6 Official Med RiskDeveloper-friendly load and performance testing tool running JavaScript test scripts in an embedded Go engine. Supports k6 inspect to parse script options as JSON, --summary-export for structured JSON latency/error metrics, and --no-color clean logs.
brew install k6 Generates controlled HTTP/gRPC/WebSocket load directly from local scripts against local or staging endpoints.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides k6 inspect JSON metadata, --summary-export=<file> JSON results, --no-color, and threshold exit codes.
k6 inspectprints script options and thresholds as JSON--summary-exportexports structured latency/error metrics
k6 inspect parses without sending traffic, though live k6 run can overwhelm endpoints if --vus/--duration are uncapped.
k6 inspectperforms safe static option evaluation- Live runs send real network load to target URLs
Single static Go binary with embedded JS runtime across macOS, Linux, and Windows—zero Node.js dependency.
- Self-contained Go binary with no external JS runtime required
Expressive JS scripting with built-in HTTP, WebSocket, gRPC, and threshold assertions for CI performance gates.
- Built-in
thresholdsprovide automated pass/fail exit codes
Official Grafana Labs project under AGPL-3.0 with frequent releases.
- First-party
grafana/k6repository
Excellent documentation at grafana.com/docs/k6/latest/ covering CLI flags and JS APIs.
- Comprehensive reference at grafana.com/docs/k6/latest/
Security, Auth & Guardrails
Local load tests need no auth; Grafana Cloud k6 uses K6_CLOUD_TOKEN or ~/.config/loadimpact/k6/config.json.
AGPL-3.0 open-source Go binary is free; optional Grafana Cloud k6 distributed runs are usage-billed.
# Grafana k6 Agent Rules - ALWAYS inspect scripts with `k6 inspect <file>` before running, and cap `--vus` and `--duration` during local tests. - NEVER point `k6 run` at production endpoints without explicit user approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
k6 inspect script.js
Parses the test script and prints resolved VUs, stages, and thresholds in JSON without sending traffic.
Controlled Writes & Previews
k6 run --vus 2 --duration 10s --no-color --summary-export=/tmp/k6-summary.json script.js
Runs a low-load 10-second smoke test and exports percentile latency and error metrics as JSON.
Strengths for Agents
- + Single Go binary runs JS load tests without requiring Node.js.
- +
k6 inspectand--summary-exportgive agents clean JSON before and after runs. - + Built-in
thresholdsproduce deterministic pass/fail exit codes.
Caveats & Pitfalls
- ! Running scripts with high VU counts against live URLs can act as an accidental DoS if not bounded.
- ! Uses an embedded ES module subset (soja/goja), not Node.js APIs.