Running K6 through Powershell with xk6 influxdb extension fails

I get this error code when trying to output results to influxDB v2.x via my Powershell script in the same directory as my k6 build.

invalid output type ' xk6-influxdb', available types are: cloud, csv, experimental-prometheus-rw, influxdb, json, statsd, xk6-influxdb

$influx_addr = "http://localhost:8086"

$influx_org = 'my_org'

$influx_bucket = 'my_bucket'

$influx_token = 'my_token'

$influx_info = $env:K6_INFLUXDB_ADDR = $influx_addr; $env:K6_INFLUXDB_ORGANIZATION = $influx_org; $env:K6_INFLUXDB_BUCKET = $influx_bucket; $env:K6_INFLUXDB_TOKEN = $influx_token;

$out = $env:K6_OUT = '-o xk6-influxdb=http://localhost:8086/my_bucket'

$influx_info; .\k6.exe run .\PerformanceTest.js $out 

Hi @DuneZerna. When specifying your output using the K6_OUT environment variable, you should not use the -o argument flag.

$out = $env:K6_OUT = ‘-o xk6-influxdb=http://localhost:8086/my_bucket

should instead be

$out = $env:K6_OUT = ‘xk6-influxdb=http://localhost:8086/my_bucket

Then, with the environment variable set, you can remove the use of the $out variable from your actual command as in:

$influx_info; .\k6.exe run .\PerformanceTest.js

P.S. I’m not a Windows user…so I can’t verify any of this.

1 Like