18

I'm trying out Artillery.io (http://artillery.io) as a load and performance tool, but I can't seem to get the debugging working.

I'm seeing the output and reports get generated, but for certain HTTP responses (404/401/500.x) I want to see the packets sent and responses received retrospectively.

The documentation at https://artillery.io/docs/debugging.html#logging-everything says that I can run

set DEBUG=http,http:capture,http:response

and then launch my script using the run command (I'm on Windows).

This makes no difference at all, there is no tracing of packets sent/received in either the console or the generated report.

Anyone know how to get artillery to trace out what its doing, request by request and response? Preferably added to the report file, but I'll take console alone if I have to.

pbaranski
  • 22,778
  • 19
  • 100
  • 117
BlackSpy
  • 5,563
  • 5
  • 29
  • 38
  • Hi there, it's been a year and a half since this question was asked, but i started facing this problem(i'm on Windows as well). Could you describe steps you have performed in order to resolve this issue? – Kyle Bak Jan 04 '19 at 15:13
  • 1
    Hi Kyle - In my case I was attempting to run this from PowerShell. If I run from a normal CMD prompt terminal on windows or Terminal on Mac/Nix it works fine. These settings are environment variables, so if you have to use PowerShell the comment from Peng Tuck Kwok in the solution below will work as well. – BlackSpy Jan 17 '19 at 08:53
  • 1
    Looks like the debugging.html page has been replaced. New link is https://artillery.io/docs/examples/#debugging-http-tests – Jim Wooley May 29 '20 at 17:11

4 Answers4

4

Was running this from a powershell console. Dropped down to good old CMD and it works as documented.

BlackSpy
  • 5,563
  • 5
  • 29
  • 38
3

Tested on Windows in Git Bash terminal.

Setting debug:

 export DEBUG=http,http:capture,http:response

Testing:

 echo $DEBUG

Running script for tests

For Artillery v2

Create file script.yml:

config:
  target: "https://httpbin.org/"
  phases:
    - duration: 3
      arrivalRate: 1
scenarios:
  - name: "Get"
    flow:
      - get:
          url: "/get"

run it: artillery run script.yml

For Artillery v1 see docs.

artillery quick -c 1 -n 1 https://httpbin.org/get

Debug response:

Started phase 0, duration: 1s @ 16:20:02(+0200) 2021-05-11
/   http request: {
  "url": "https://httpbin.org/get",
  "method": "GET",
  "headers": {
    "user-agent": "Artillery (https://artillery.io)"
  }
} +0ms
  http:response {
  http:response   "date": "Tue, 11 May 2021 14:20:03 GMT",
  http:response   "content-type": "application/json",
  http:response   "content-length": "254",
  http:response   "connection": "keep-alive",
  http:response   "server": "gunicorn/19.9.0",
  http:response   "access-control-allow-origin": "*",
  http:response   "access-control-allow-credentials": "true"
  http:response } +1ms
  http:response "{\n  \"args\": {}, \n  \"headers\": {\n    \"Host\": \"httpbin.org\", \n    \"User-Agent\": \"Artillery (https://artillery.io)\", \n    \"X-Amzn-Trace-Id\": \"Root=1-609a9293-031b2371069a353d0cbb4131\"\n  }, \n  \"origin\": \"213.76.55.123\", \n  \"url\": \"https://httpbin.org/get\"\n}\n" +1ms
Report @ 16:20:04(+0200) 2021-05-11 
pbaranski
  • 22,778
  • 19
  • 100
  • 117
0

In Powershell you would have to set the environment variable DEBUG to eg http like this:

$Env:DEBUG = "http"

You can check the current value as follows:

$Env:DEBUG

See Powershell docs on Using and changing environment variables.

Johan Maes
  • 1,161
  • 13
  • 13
-1

Update: looks like http debugging was changed. See https://artillery.io/docs/examples/#debugging-http-tests for the revised debugging documentation.

Jim Wooley
  • 10,169
  • 1
  • 25
  • 43