`vus` metric on DataDog doesn't have `scenario` tag

I’m trying loadtesting on grpc endpoint.
I exported metrics to DataDog following the procedure on document and almost everything goes fine, but I’m in trouble that I wrote in title.

Is it normal behavior? (or something I try exist?)
Thanks for your help in advance.

references:

Hi there, welcome to the forum :slight_smile:

This is likely caused by the known issue #1833. Unfortunately, the vus metric is emitted in a different way from the rest of the metrics, which is why it’s not tagged as the rest.

I tried doing a workaround with a custom metric and the k6/execution module.

import { Gauge } from 'k6/metrics';
import exec from 'k6/execution';

const myVUs = new Gauge('my_vus');

export default function() {
  myVUs.add(exec.instance.vusActive, { scenario: exec.scenario.name });
  ...
}

But for some reason I’m not seeing the tag in Datadog, while it appears fine in the JSON output :confused::

{
  "metric": "my_vus",
  "type": "Point",
  "data": {
    "time": "2022-12-12T17:53:34.266135382+01:00",
    "value": 5,
    "tags": {
      "group": "",
      "scenario": "ramping"
    }
  }
}

I’m not sure if there’s a way to make this work, but maybe someone else has a better idea. In the meantime, you can subscribe to the GitHub issue to get notified when this is fixed. It’s currently not a high priority, but you can vote for it with a :+1: and we’ll plan it for an upcoming release.

EDIT: Ah, the custom metric workaround does actually work :tada:

It apparently takes a while for Datadog to process tags on metrics. So feel free to use that approach while #1833 is fixed.

1 Like

Thanks for the reply & propose workaround! I’ll try it!