No results for

Powered byAlgolia

Cloud APM

suggest edits

k6 Cloud platform supports exporting metrics to APM platforms, thereby enabling users to export metrics from a running test in near real-time to their preferred APM platform(s).

Supported APM Providers

Currently, the following platforms are supported:

This list will be expanded in the future. Please contact us if you would like an integration that isn't currently listed.

Cloud APM Configuration

For maximum flexibility, the APM export functionality is configured on the test-run level. The required parameters should be specified in options.ext.loadimpact.apm (See extension options for more information). The configuration parameters are as follows:

NameDescription
providerAny APM provider name available in the supported APM provider's table.
api_keyThe api_key provided by the APM platforms.
app_keyThe app_key provided by the APM platforms, if applicable.
metricsList of built-in and custom metrics to be exported.
include_default_metricsIf set, the export will include the default metrics. Default is true.
resample_rateThe rate by which the metrics are resampled and sent to the APM provider in seconds. Default is 3 and acceptable values are integers between 1 and 10.
include_test_run_idIf set, the test_run_id will be exported per each metric as an extra tag. Default is false.

Note: This guide will walk you through creating an api_key and an app_key on Datadog. Note that the api_key and app_key for datadog won't work on datadogeu.

The metrics parameter allows you to specify built-in and custom metrics to be exported to the APM provider. By default, only the basic metrics listed below are exported. These defaults also match the official k6 dashboard for Datadog, which you can read more about on visualization of metrics in Datadog.

  • data_sent
  • data_received
  • http_req_duration
  • http_reqs
  • iterations
  • vus

A typical use case is to only export custom metrics defined in the script. To do that you should specify the names of your custom metrics in the metrics parameter, and set include_default_metrics to false.

If you want to export metrics with more granularity, consider using a lower number for the resample_rate, like 1.

The apm key (inside ext.loadimpact) accepts a list of APM configurations (objects). Exporting metrics to APM platforms will be simultaneous and near real-time. Also, there is a 2nd pass (of metrics exports), at the end of each test run, that ensures data reliability and accuracy. Please note that the data exported in real-time may appear incorrect until the test is finished.

export let options = {
ext: {
loadimpact: {
apm: [
{
provider: "datadog",
api_key: "<Datadog Provided API key>",
app_key: "<Datadog Provided App key>",
metrics: ["http_req_sending", "my_rate", "my_gauge", ...],
include_default_metrics: true,
include_test_run_id: false
},
]
},
},
};

Make sure to meet the following requirements, otherwise, we can't guarantee a working metrics export:

  1. If you use custom metrics in your script, remember to add them to the metrics array, otherwise, those metrics won't be automatically exported.
  2. If you want to export built-in metrics that are not listed above, you can include them in the metrics array.
  3. If the APM configuration has errors, (e.g. invalid provider, wrong credentials, etc) the configuration will be ignored, and the test will be executed without the APM functionality.
  4. If you provide invalid metrics to the metrics field, the test will continue, but the metrics export(s) will not include the invalid metric.
  5. The metrics defined in metrics are case-sensitive.
  6. The official k6 dashboard on Datadog gives you the ability to filter metrics based on test_run_id, but we don't export test_run_id as an extra tag by default. If you want to export it, you should set include_test_run_id to true.

Limitations

  1. APM data export is supported for tests that are up to 1 hour long. Longer tests are currently not supported.
  2. The data exported in near real-time may appear incorrect until the test is finished and the 2nd pass export has completed.

Feature Availability

This feature is only available for certain subscriptions:

  • Trial
  • Monthly Pro
  • Annual Team/Pro
  • Enterprise