Save and share results in k6 Cloud

A baseline is only useful if you can compare it against future runs. By streaming your results to k6 Cloud, you store your baseline in a central location where you can track performance over time, compare runs side by side, and share results with your team.

To send your baseline results to k6 Cloud, complete the following steps:

  1. Log in to Grafana Cloud k6 from the CLI using your API token:

    Bash
    k6 cloud login --token <YOUR_API_TOKEN> --stack <YOUR_STACK_SLUG>

    You can find your API token and stack slug in Grafana Cloud under Testing & synthetics > Performance > Settings. For details, refer to Tokens and CLI authentication.

  2. Run your baseline test with the --local-execution flag to execute locally and stream results to the cloud:

    Bash
    k6 cloud run --local-execution baseline.js

    Note

    The --local-execution flag runs the test on your machine and streams the results to k6 Cloud. This differs from k6 cloud run without the flag, which uploads your script to run on cloud infrastructure.

  3. Copy the URL displayed in the terminal output. k6 provides a direct link to the results page:

    text
    output: cloud (https://acmecorp.grafana.net/a/k6-app/runs/123456)
  4. Open the URL in your browser and sign in to your Grafana Cloud account if you aren’t already signed in.

  5. Review the Performance Overview section, which shows your key baseline metrics at a glance, including response time trends and request rates.

  6. Click the Thresholds tab to verify your threshold results in the cloud view. Green and red markers show which thresholds passed and which failed.

  7. Click the Checks tab to inspect your check pass rates.

Each time you run the test with cloud output, k6 Cloud stores the results. You can compare your baseline run against future runs to detect performance regressions. Share the results URL with your team so everyone has visibility into the system’s performance characteristics.

You’ve completed all the milestones in this path.

Were you successful?

More to explore (optional)

At this point in your path, you can explore the following topics:

Inspect test results in Grafana Cloud k6

Tokens and CLI authentication


page 9 of 10