k6 cloud
Run and manage tests in Grafana Cloud k6.Synopsis
Description
Thek6 cloud command provides subcommands for running and managing load tests in Grafana Cloud k6. Cloud execution offers:
- Distributed load generation from multiple geographic locations
- Scalability beyond single-machine limitations
- Real-time metrics visualization
- Historical test result storage
- Team collaboration features
Running tests directly with
k6 cloud <file> is deprecated. Use k6 cloud run <file> instead.Subcommands
k6 cloud login
Authenticate with Grafana Cloud k6.k6 cloud run
Run a test in Grafana Cloud.k6 cloud upload
Upload a test to Grafana Cloud without running it.Examples
Flags (for k6 cloud run)
Enable showing of logs when a test is executed in the cloud
Exit when test reaches the running status (don’t wait for completion)
Test Configuration Flags
All standard test configuration flags fromk6 run are available:
Number of virtual users
Test duration
Total iteration limit
Add execution stages
Environment Variables
Grafana Cloud k6 authentication token
Grafana Cloud k6 API host (default:
https://ingest.k6.io)Project ID for organizing tests
Stack ID for the Grafana Cloud instance
Show cloud logs during test execution
Exit when test starts running
Authentication
Before running cloud tests, you must authenticate using one of these methods:Interactive Login (Recommended)
Token Authentication
Script Configuration
Add to your script:Project Configuration
Tests can be organized into projects:Cloud Test Options
Additional cloud-specific options can be configured in your script:Monitoring Test Progress
When running a cloud test:- The script is uploaded and validated
- A test URL is displayed for real-time monitoring
- Progress is shown in the terminal
- Logs are streamed (if
--show-logsis enabled) - The command exits when the test completes
Exit Codes
0- Test completed successfully99- Thresholds failed108- Test marked as failed- Other non-zero codes indicate errors
Stopping Cloud Tests
PressCtrl+C to gracefully stop a running cloud test. The test will be marked as stopped in Grafana Cloud.
See Also
- k6 login - Authentication details
- k6 run - Local test execution
- k6 archive - Create test archives
- Grafana Cloud k6 Documentation