Send test results to Grafana Cloud

In this milestone, you send your k6 test results to Grafana Cloud for real-time visualization and analysis.

  1. In the main menu, go to Testing & synthetics > Performance > Settings.

  2. Under Access, click Personal token, then copy your API token. You’ll use it in the next step to authenticate k6. For other token types, refer to Authenticate on the CLI.

  3. In your terminal, navigate to the directory where you saved your script.js file, then log in to Grafana Cloud k6:

    Bash
    k6 cloud login --token YOUR_API_TOKEN --stack YOUR_STACK_URL

    Replace YOUR_API_TOKEN with the token you copied. Replace YOUR_STACK_URL with your stack URL (for example, https://my-team.grafana.net) or stack slug (for example, my-team).

  4. Run your test with the --local-execution flag to stream results to Grafana Cloud:

    Bash
    k6 cloud run --local-execution script.js
  5. After 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/...)

  6. 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.


page 6 of 8