k6 Documentation Skill
Description
This skill helps users navigate and apply the official Grafana k6 documentation for writing and running load tests. It provides direct guidance and references for:
- k6 core concepts (scenarios, thresholds, executors)
- k6 JavaScript APIs (http, check, sleep, group, etc.)
- k6 examples and best practices
Sources
- https://grafana.com/docs/k6/latest/
- https://grafana.com/docs/k6/latest/javascript-api/k6-http/
- https://grafana.com/docs/k6/latest/examples/
Workflow
- Understand the question: Determine what part of k6 the user needs help with (e.g., scripting HTTP requests, setting thresholds, running in CI).
- Map to documentation: Point to the exact section(s) in the Grafana k6 documentation and optionally provide a short, practical snippet.
- Provide next steps: Suggest concrete actions (e.g., “Use
http.get()in a default function”, or “Define athresholdsobject in your options”).
Examples
This skill includes a small set of example k6 scripts (mirroring the official examples) to help you get started quickly.
examples/get-started-with-k6.jsexamples/single-request.jsexamples/http-authentication.jsexamples/data-parameterization.js
Usage
Ask anything like:
- "How do I set a custom metric in k6?"
- "What is the difference between
ramping-arrival-rateandconstant-vus?" - "Show me an example of
k6/httpPOST request with JSON body."