Artillery.IO Logging and Debugging

Viewed 12321

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.

4 Answers

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 

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.

Related