With this integration, you can export test result metrics from the k6 Cloud to DataDog. That allows querying, visualizing and correlating k6 metrics with other monitored metrics in Datadog.
⭐️ Cloud APM integrations are available on Pro and Enterprise plans, as well as the annual Team plan and Trial.
To set up the integration on the k6 Cloud, you need the following DataDog settings:
- API key
- Application key
Follow this guide to get your API and application keys.
The supported regions for the DataDog integration are:
- eu: Europe.
- us: rest of the world (default).
API and Application keys for a DataDog region won't work on a different region.
You have to enable the DataDog integration for each test that you want to export its test result metrics.
Once you have set up the DataDog settings in the test, you can run a cloud test as usual. When running the cloud test, the k6 Cloud will continuously send the test results metrics to DataDog.
Currently, there are two options to set up the Cloud APM settings in the test:
First, you have to configure the DataDog integration for an organization. Click the Cloud APM option on the left sidebar menu under the Manage section, and select DataDog from the list.
In this form, set the API and application keys that you copied previously from DataDog. For more information on the other input fields, see configuration parameters.
Save the DataDog configuration for the current organization.
Note that configuring the DataDog settings for an organization does not enable the integration. You have to enable it manually for each test using the test builder.
now, create a new test with the test builder or select a test - previously created with the test builder. click the cloud apm option on the test builder sidebar to enable the integration for the test.
If you script your k6 tests, you can also configure the Cloud APM settings using the apm option in the k6 script.
The parameters to export the k6 metrics to DataDog are as follows:
|provider(required)||For this integration, the value must be datadog.|
|apiKey(required)||DataDog API key.|
|appKey(required)||DataDog application key.|
|region||The region supported by DataDog. See the list of supported regions. Default is us.|
|includeDefaultMetrics||Whether it exports the default APM metrics: data_sent, data_received, http_req_duration, http_reqs, iterations, and vus. Default is true.|
|metrics||List of built-in and custom metrics to export.|
|includeTestRunId||Whether all the exported metrics include a test_run_id tag whose value is the k6 Cloud test run id. Default is false. |
Be aware that enabling this setting might increase the cost of your APM provider.
|resampleRate||The 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.|