Xk6-output-influxdb - xk6 binary isn't installing with go install command

Hello Team,

I have my k6 scripts running locally and want to send the results to influxdb as i can visulaize them in grafana. I have installed influxdb V2 and grafana locally.
As per the doc i am supposed to have go tool chain and xk6 binary installed in order to perform the above.

I have installed go1.21.3.windows-amd64 and have set the go path in environment variables. When i run “go install go.k6.io/xk6/cmd/xk6@latest” from by bin directory it isn’t installing anything neither its throwing any error.

am getting the below when i do xk6 in cmd
“Z:>xk6
go: cannot match “all”: go.mod file not found in current directory or any parent directory; see ‘go help modules’
2023/11/01 17:03:00 [ERROR] exec [go list -mod=readonly -m -f={{if .Replace}}{{.Path}} => {{.Replace}}{{end}} all]: exit status 1:”

What am I missing here? Why am i not able to install xk6?
When the installation happens is it supposed to pull this repo grafana/xk6-output-influxdb repo into my system??

I tried, go install github.com/cosmtrek/air@latest. It installed successfully. So am assuming there isn’t any problem with go install.

Can someone please please guide me.

Thankyou

Hi @bjrakshita! Welcome to the forum!

This error message tells to me, that you successfully installed xk6, you just have to run it with the correct parameters.
If you want to build the xk6-output-influxdb extension into the k6, then you should run:

xk6 build --with github.com/grafana/xk6-output-influxdb

This will create a k6 binary in your current directory.

3 Likes

Thank you @bandorko :smiley: