1

I installed k6 v0.35.0, go 1.17.3, xk6@latest, Prometheus 2.32.0-beta.0, xk6-output-prometheus-remote@latest, and try to run k6 script, but I got below error:

error image

I want to know whether k6 open source can save test result in Prometheus?

  • Please, no pictures of code or terminal output in your question. Include it as code block. That allows others to copy&paste and try your code – knittl Dec 05 '21 at 10:57

1 Answers1

0

You are trying to execute a command with syntax used in Linux/POSIX shells in Microsoft's PowerShell. PowerShell uses different syntax to set environment variables for commands.

To set an environment variable in PowerShell, you have to execute a separate command before running your actual command.

$env:K6_PROMETHEUS_REMOTE_URL = 'http://172.21.2.29:9090/api/v1/write'
./k6 run main_smoke_test.js -o output-prometheus-remote

Alternatively, you can install Git Bash to have a POSIX compatible shell available.

knittl
  • 246,190
  • 53
  • 318
  • 364