Section 2 · Your first performance test

Hands-on path to run your first k6 performance test

Estimated time: 2 min

Learning path: Run your first k6 performance test

Path: Run your first k6 performance test

StepWhat you’ll doOutcome
1. Install k6Download and install the k6 CLIk6 available in your terminal
2. Write a test scriptCreate a JavaScript file with HTTP requests and checksA complete test script
3. Run locallyExecute k6 run test.js and read the outputTerminal metrics: latency, throughput, errors
4. Connect to Grafana CloudAuthorize the CLI with a Grafana Cloud k6 API token (k6 cloud login)Ready for Grafana Cloud k6
5. Run on Grafana Cloud k6Execute k6 cloud run test.jsStored run in Grafana Cloud k6 dashboards

Before you start

Have these ready before you open the path (the path itself installs k6 and walks through the script):

  • Terminal, code editor, and your Grafana Cloud account
  • Targets QuickPizza only in this path (not your production systems)
  • Optional help with the script: In Grafana Cloud, use Grafana Assistant in k6 Script Authoring mode to draft or refine the JavaScript before you run locally. Refer to Use k6 Script Authoring mode; the Prerequisites slide summarizes access, when Assistant is not visible, and an example prompt you can paste. Use Assistant output as a draft and match the path’s script.js before k6 run.
Learning path

Run your first k6 performance test

Welcome to the Grafana learning path that shows you how to write, run, and analyze your first k6 performance test, from installation to visualizing results in Grafana Cloud.

11 min
Beginner
Docs & blog posts

Open in Grafana Cloud

Complete this learning path directly in your Grafana Cloud stack with an interactive learning experience.