Using a Squid proxy

Squid is a forward proxy for the web supporting HTTP, HTTPS, FTP, and more. It runs on most available operating systems, including Windows, and is licensed under the GNU GPL license. Squid is a straightforward option if you do not already have a running web proxy in your network. If you already have an existing proxy server, you do not need to use Squid. Instead, follow the instructions in Agent Proxy Configuration.

Proxy forwarding with Squid

To configure Squid to send traffic to Datadog, follow the instructions below to configure Squid, start the squid service, and then configure and restart the Datadog Agent.

Configure Squid to only send traffic to Datadog

Install Squid on a host that has connectivity to both your internal Agents and Datadog. Use your operating system’s package manager, or install the software directly from Squid’s project page.

To configure Squid, edit the configuration file. This file is usually located at /etc/squid/squid.conf on Linux or C:\squid\etc\squid.conf in Windows. For other operating systems, see Agent configuration directory.

Edit your squid.conf configuration file so that Squid is able to accept local traffic and forward it to the necessary Datadog intakes:

http_port 0.0.0.0:3128

acl local src 127.0.0.1/32

acl Datadog dstdomain .

http_access allow Datadog
http_access allow local manager

Start Squid

Start (or restart) Squid so that your new configurations can be applied.

sudo systemctl start squid

If Squid is already running, restart Squid instead with the following command:

sudo systemctl restart squid

If you are configuring Squid on Windows, you must first [configure Squid as a system service][4]. You can then run the following in an Administrator command prompt:

net start squid

If Squid is already running, restart Squid instead with the following commands:

net stop squid
net start squid

Configure the Datadog Agent

Modify the Agent’s configuration file (datadog.yaml) to include the following:

proxy:
  http: http://127.0.0.1:3128
  https: http://127.0.0.1:3128

After saving these changes, restart the Agent.

Verify that Datadog is able to receive the data from your Agent(s) by checking your Infrastructure Overview.

Further Reading

Additional helpful documentation, links, and articles:

PREVIEWING: arbll/simplify-proxy