Menu
Grafana Cloud

Cloud options

When executing a k6 test, you can run them locally, or in the cloud. When running tests on Grafana Cloud, you have access to additional configuration options that you can define in the options object, such as load zones, or static IP addresses.

These configuration options are optional.

Note

This page only covers cloud options. For more information about all available options parameters, refer to Options.

Example

In your test script, you can configure cloud options by using the options.cloud object:

JavaScript
export const options = {
  cloud: {
    name: 'Hello k6 cloud!',
    projectID: 123456,
    staticIPs: true,
    drop_metrics: ['http_req_tls_handshaking', 'http_req_waiting', 'http_req_connecting'],
    drop_tags: { '*': ['instance_id'] },
    keep_tags: { http_req_waiting: ['instance_id'] },
    distribution: {
      distributionLabel1: { loadZone: 'amazon:us:ashburn', percent: 50 },
      distributionLabel2: { loadZone: 'amazon:ie:dublin', percent: 50 },
    },
    note: 'Anything that may be worth noting about your test.',
  },
};

Options and syntax

NameDefaultDescription
name (string)The name of the main script file, so something like script.js.The name of the test in the k6 Cloud UI. Test runs with the same name will be grouped.
projectID (number)Empty.The ID of the project to which the test is assigned in the k6 Cloud UI.
distribution (object)The equivalent of someDefaultLabel: { loadZone: "amazon:us:ashburn", percent: 100 }.How the traffic distributes across existing Load Zones. The keys are string labels that will be injected as environment variables.
staticIPs (boolean)false by defaultWhen set to true, k6 will use dedicated IPs assigned to your organization to execute the test. Refer to Cloud IPs for more details.
note (string)Empty by default.Notes regarding the test, changes made, or anything to note about your test.
deleteSensitiveData (boolean)false by defaultIf true, k6 deletes sensitive data as soon as the test starts running or, if still queued, when the test aborts. Sensitive data includes scripts, HAR files, archives, and APM credentials.
drop_metrics (array)Empty by defaultDrops the metrics listed in the array during ingestion time. E.g. ["http_req_tls_handshaking"]. This helps reduce the cardinality of time series. Note some metrics are required and can’t be dropped.
drop_tags (object){"*": [“instance_id”]}Drops tags for a specified metric, where the metric is the key and the tags are an array. E.g. {"http_req_duration": ["instance_id"]}. This helps reduce the cardinality of time series. The wildcard * can be used to drop specific tags on every metric.
keep_tags (object)Empty by defaultKeeps tags for a specified metric, where the metric is the key and the tags are an array. E.g. {"http_req_duration": ["instance_id"]}. This helps reduce the cardinality of time series. The wildcard * can be used to drop specific tags on every metric. This option takes precedence over drop_tags.

The deleteSensitiveData option is unavailable in default subscriptions. If you want to activate it, contact our CS team at support@k6.io.

Options to reduce time series

The Too many time series alert aborts a test run. Sometimes, though, a test might trigger the alert even if the script follows all recommended practices from the performance insight. In these cases, you can consider the drop_metrics and drop_tags options.

Note that if you use these options, some graphs may appear empty for the metrics deleted.

Certain important tags and metrics can’t be dropped:

  • For metrics, you can’t drop vus.
  • For tags, you can’t drop:
    • instance_id from iterations, load_generator_cpu_percent, load_generator_file_handles, load_generator_memory_percent, vus, and vus_max.
    • test_run_id.