Skip to main content

Grafana Cloud k6

Grafana Cloud k6 is a performance-testing application that’s part of Grafana Cloud. It lets you leverage all of the k6 capabilities, while Grafana handles the infrastructure work of scaling servers, handling distributed load zones, and storing and aggregating metrics from your tests.

Key features

Cloud execution

Run tests from multiple geographic locations without managing infrastructure.

Built-in dashboards

Visualize test results with pre-configured Grafana dashboards.

Performance insights

Get automated insights into your application’s performance.

Team collaboration

Share test results and collaborate with your team in one place.

Distributed testing

Generate load from multiple regions simultaneously.

Historical data

Compare test runs over time to track performance trends.

Getting started

1

Create a Grafana Cloud account

Sign up for Grafana Cloud at grafana.com.
2

Get your API token

Generate a k6 Cloud API token from your Grafana Cloud settings.
3

Login with k6 CLI

Authenticate your local k6 CLI:
k6 login cloud --token YOUR_API_TOKEN
4

Run your first cloud test

Execute any k6 script in the cloud:
k6 cloud script.js

Cloud vs local execution

Run tests from your machine with results stored locally:
k6 run script.js
Pros:
  • No additional costs
  • Full control over environment
  • Quick iteration during development
Cons:
  • Limited by local machine resources
  • Single geographic location
  • Manual result storage

Load zones

Grafana Cloud k6 supports distributed testing from multiple geographic locations:
  • North America: US East, US West, Canada
  • Europe: Ireland, Frankfurt, London
  • Asia Pacific: Tokyo, Sydney, Singapore
  • South America: São Paulo

Configuring load zones

export const options = {
  ext: {
    loadimpact: {
      distribution: {
        'amazon:us:ashburn': { loadZone: 'amazon:us:ashburn', percent: 50 },
        'amazon:ie:dublin': { loadZone: 'amazon:ie:dublin', percent: 50 },
      },
    },
  },
};

Cloud features

Performance insights

Grafana Cloud k6 automatically analyzes your test results and provides:
  • Performance trends - Compare runs over time
  • Anomaly detection - Identify unusual patterns
  • Recommendations - Suggestions for optimization
  • SLO tracking - Monitor against service level objectives

Team collaboration

  • Share test results with team members
  • Comment on test runs
  • Set up notifications for test failures
  • Manage team access and permissions

CI/CD integration

Integrate cloud tests into your pipeline:
- name: Run k6 cloud test
  uses: grafana/[email protected]
  with:
    cloud: true
    token: ${{ secrets.K6_CLOUD_TOKEN }}
    filename: test.js

Pricing

Grafana Cloud k6 offers different pricing tiers based on:
  • Number of virtual user hours (VUh)
  • Test frequency and duration
  • Number of load zones
  • Data retention period
Check grafana.com/pricing for current pricing details and free tier limits.

Migration from k6 OSS

Migrating from open-source k6 to Grafana Cloud k6 is straightforward:
1

No code changes required

Your existing k6 scripts work without modification.
2

Add cloud configuration (optional)

Configure cloud-specific options if needed:
export const options = {
  ext: {
    loadimpact: {
      projectID: YOUR_PROJECT_ID,
      name: 'My Test',
    },
  },
};
3

Run with cloud command

Change k6 run to k6 cloud:
k6 cloud script.js

Best practices

Develop and debug your tests locally before running them in the cloud to save costs and iterate faster.
Select load zones close to your users or infrastructure for realistic results.
Track your VU hour consumption to optimize test duration and frequency.
Set thresholds to automatically fail tests that don’t meet performance criteria:
export const options = {
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
  },
};

Documentation

For comprehensive Grafana Cloud k6 documentation, visit: grafana.com/docs/grafana-cloud/testing/k6

Distributed tests

Running tests across multiple machines

Automated testing

CI/CD integration guide

Results output

Understanding and exporting results

k6 Studio

Visual test creation tool

Build docs developers (and LLMs) love