Changing new relic (statsd) metrics prefix 'k6'

I have integrated k6 with new relic New Relic . It’s working fine and I can see metrics with prefix k6 but I want to change this prefix and for that I’m using K6_STATSD_NAMESPACE but still the prefix is ‘k6’ .Command that I’m using is:
k6 run --out statsd --vus=1000 -e K6_STATSD_NAMESPACE=“dynaman” single.js

Hi @Jai, welcome to the forum

-e is only so that the script can see something as an environmental variable. You should use

K6_STATSD_NAMESPACE=“dynaman” k6 run --out statsd --vus=1000   single.js

or run export K6_STATSD_NAMESPACE=“dynaman” before running the k6 script.

Hope this helps, and sorry for the confusion

Thanks for so quick reply. It’s working but It’s missing dot(.) after prefix :
It’s visible as ‘dynamancheck.status_was_200.pass’ while I want like ‘dynaman.check.status_was_200.pass’ as it was with prefix k6: k6.check.status_was_200.pass

What happens if you instead do K6_STATSD_NAMESPACE=“dynaman.” k6 run --out statsd --vus=1000 single.js? :sweat_smile:

Not sure if i’m doing something stupid or not but I’m getting an error when I attempt to change my prefix.

Does this have to be run from a specific location?

It seems like the way to define environment variables in PowerShell is slightly different than other terminals. More info: