K6 cloud and datadog debug


We run k6 cloud and I am trying to get the Datadog integration working. Is there a way to debug the config, because at the moment it all runs fine, but I see no metrics in Datadog

Documentation says that if the config is wrong it will be ignored, so it’s a bit tricky to figure what went wrong.

Here is my config

export const options = {
stages: [
{ duration: “2m”, target: 100 },
{ duration: “5m”, target: 100 },
{ duration: “2m”, target: 200 },
{ duration: “5m”, target: 200 },
{ duration: “5m”, target: 600 },
{ duration: “1m”, target: 600 },
{ duration: “5m”, target: 50 }
thresholds: {
‘http_req_duration’: [‘p(90)<1000’]
ext: {
loadimpact: {
name: ‘Test’,
projectID: XXX,
vus: 600,
duration: ‘25m’,
distribution: {
“amazon:ie:dublin”: { loadZone: “amazon:ie:dublin”, percent: 50 },
“amazon:se:stockholm”: { loadZone: “amazon:se:stockholm”, percent: 50 },
apm: [
provider: “datadog”,
apiKey: __ENV.API_KEY,
appKey: __ENV.APP_KEY,
region: “eu”,
includeDefaultMetrics: true,
includeTestRunId: true

Hey @nonak,

If you are running your script on the k6 Cloud directly (from script editor), the reason might be the __ENV.* variables. They’re not translated to their values yet, unless you’re running k6 -o cloud or k6 cloud locally.

You might find debugging info in the Logs tab, while your test is running.

For the moment, I suggest you replace the environment variables with their values and test again. Also note that API and App key for us region cannot be used for eu.

Ok thank you. I run “k6 cloud” locally, and I outputted the value in logs just to make sure, and it shows correctly, so I am pretty sure they are passed.

I am only using the API and App key from eu to eu.

May I know your test id? You can also message me.
Upon chat over Slack, the issue was found and fixed by enabling APM on the subscription.

Thank you very much, indeed the metrics are now showing correctly in Datadog

1 Like