Send test results to Grafana Cloud
In this milestone, you send your k6 test results to Grafana Cloud for real-time visualization and analysis.
In the main menu, navigate to Testing & synthetics > Performance.
In the left navigation under Performance, select Settings to find your API token.
Copy your API token from the Settings page. You’ll use it in the next step to authenticate k6.
In your terminal, navigate to the directory where you saved your
script.jsfile, then log in to Grafana Cloud k6:k6 cloud login --token YOUR_API_TOKENReplace
YOUR_API_TOKENwith the token you just copied.Run your test with the
--local-executionflag to stream results to Grafana Cloud:k6 cloud run --local-execution script.jsAfter the test completes, scroll up in your terminal output and find the
output:line. It contains a URL like:output: cloud (https://your-stack.grafana.net/a/k6-app/runs/...)Copy this URL — it links to your test results in Grafana Cloud. You’ll use it in the next milestone to view your results.
In the next milestone, you analyze your test results in Grafana Cloud dashboards.