InfluxDB+Grafana

Hello Everyone

I am following this page -for K6, Grafana and InfluxDB integration.

k6 loves Grafana

I am stuck at the moment.
with this command → docker-compose run -v $PWD:/scripts k6 run /scripts/myscript.js

I have my scripts ready with folder structure - /Users/{myid}/Apply/test/k6/ApplySolaBFF/solaApply.js (edited)

I am not able to understand how to run my solaApply.js file in the command docker-compose run -v $PWD:/scripts k6 run /scripts/myscript.js (edited)

this command is given in the page itself. I need to understand where my scripts should be located and what command should i run with docker-compose

This is the clone structure of the K6 for integration Grafana+InfluxDB

This is the folder location where my script is currently.

Just let me know, Where should i keep my script so that it will run with this command.
docker-compose run -v $PWD:/scripts k6 run /scripts/myscript.js

Hi, welcome to the forum.

Since your ApplySolaBFF directory is at the root level of the k6 repo where the docker-compose.yml is located, you should be able to run:

docker-compose run -v "$PWD:/scripts" k6 run /scripts/ApplySolaBFF/solaApply.js 

Note that $PWD expands to your current working directory (from where you run the command), which is mounted as /scripts in the container, so any subdirectories should be under that structure.

Remember to run docker-compose up -d influxdb grafana before the run command to start InfluxDB and Grafana.

HTH, otherwise let us know the exact error message you’re getting.

Where should i keep my script so that it will run with this command. docker-compose run -v $PWD:/scripts k6 run /scripts/myscript.js

For that command to work myscript.js should exist in your current working directory. But that’s just an example, you’re free to name your scripts and use whatever directory structure that works for you.

See the Docker volume documentation for details.

1 Like