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.
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.
The simplest approach uses a wildcard to allow all subdomains of your Datadog site:
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
Alternatively, if you require more granular control, you can explicitly list each Datadog endpoint instead of using a wildcard. For the full list of domains and IP ranges the Agent needs to reach, see Network Traffic. For example:
The example below only includes a subset of Datadog endpoints. Make sure to include all domains required by the Datadog features you use. See [Network Traffic][7] for the complete list.
http_port 0.0.0.0:3128
acl local src 127.0.0.1/32
acl Datadog dstdomain agent.
acl Datadog dstdomain process.
acl Datadog dstdomain logs.
acl Datadog dstdomain api.
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:
If Squid is already running, restart Squid instead with the following commands:
net stop squid
net start squid
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][1].
Modify the DatadogAgent CR to include the following:
spec:
global:
proxy:
http: http://squid-proxy.proxy-namespace.svc.cluster.local:3128
https: http://squid-proxy.proxy-namespace.svc.cluster.local:3128
Modify your values.yaml to include the following:
datadog:
env:
- name: DD_PROXY_HTTP
value: http://squid-proxy.proxy-namespace.svc.cluster.local:3128
- name: DD_PROXY_HTTPS
value: http://squid-proxy.proxy-namespace.svc.cluster.local:3128
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: