artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.07k stars 512 forks source link

Artillery does not seem to respect NO_PROXY environment variable #2794

Open phbreitbach opened 6 months ago

phbreitbach commented 6 months ago

VERSION INFO:

Artillery: 2.0.12 Node.js: v20.12.1 OS: linux

Running this command:

export HTTP_PROXY=http://notinmyhouse.phbreitbach.de
export HTTPS_PROXY=http://notinmyhouse.phbreitbach.de
export NO_PROXY=www.google.de
export DEBUG=http*
artillery quick -k https://www.google.de

I expected to see this happen:

  1. Calling Google succeeds because it's on the NO_PROXY list.
  2. In Debug logs I can see transparently that the proxy is called as intermediary

Instead, this happened:

  1. Calling Google did not succeed as Artillery goes via (in this case non existent) proxy
  2. The Debug logs only contain the context path which ist called and not the Host which is called. In case the proxy does not exist at all, you can additionally see a RequestError indicating the proxy (ENOTFOUND or EAI_AGAIN). However in cases where the Proxy exists but the Proxy cannot reach its target, just a 503 is pointed out, but there's no way to see which exact request resulted in the 503 and that it was directed to a proxy. So it's not possible to analyse such situations by the debug log.

It has cost me 4 days to analyze this behaviour in a scenario where after the proxy the firewall was blocking but I had no clue the request was running through the proxy at all and couldn't make Artillery tell me by DEBUG option. I think it's important to be able to analyse this by debug log besides respecting the NO_PROXY config.

Files being used: none

hassy commented 6 months ago

thanks @phbreitbach! Support for NO_PROXY is a good suggestion. We'll take a look (PR welcome too). To see which URL resulted in a specific HTTP code the metrics-by-endpoint plugin could help, though that won't tell you if a request was proxied or not.

tobiloeb commented 4 months ago

We are facing the same issue. The NO_PROXY variable is not used. Currently our workaround is, to unset the HTTP_PROXY and HTTPS_PROXY variable before running the artillery script.