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, navigate to Testing & synthetics > Performance.

  2. In the left navigation under Performance, select Settings to find your API token.

  3. Copy your API token from the Settings page. You’ll use it in the next step to authenticate k6.

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

    Replace YOUR_API_TOKEN with the token you just copied.

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

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

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