Configure proxy settings for Elastic Agent components
When running the Elastic Agent in environments that require outbound traffic to go through a proxy, you must explicitly configure proxy settings.
You may need to configure a proxy if:
- Your app is deployed behind a corporate proxy or firewall.
- Your telemetry is sent to Elastic APM in Elastic Cloud or another hosted destination.
- Network errors such as
Connection timed outorSSL handshake failedappear in logs.
| Variable | Description |
|---|---|
| HTTP_PROXY | URL of the proxy server for HTTP requests |
| HTTPS_PROXY | URL of the proxy server for HTTPS requests |
| NO_PROXY | Comma-separated list of hosts to exclude |
Most Elastic Agent components honor common proxy environment variables. The following examples show how to configure them:
docker run -e HTTP_PROXY=http://<proxy.address>:<port> \
-e HTTPS_PROXY=http://<proxy.address>:<port> \
otel/opentelemetry-collector:latest
services:
edotcollector:
environment:
- HTTP_PROXY=http://<proxy.address>:<port>
- HTTPS_PROXY=http://<proxy.address>:<port>
env:
- name: HTTP_PROXY
value: '<proxy.address>:<port>'
- name: HTTPS_PROXY
value: '<proxy.address>:<port>'
[Service]
Environment="HTTP_PROXY=http://<proxy.address>:<port>"
Environment="HTTPS_PROXY=http://<proxy.address>:<port>"
Environment="NO_PROXY=<address1>,<address2>"
Note
For the Elastic Agent, proxy support applies to all exporters, including those using gRPC. No special configuration is needed beyond the environment variables.
If you're using an SDK that doesn't support proxy variables directly, consider routing telemetry through the Elastic Agent configured with proxy settings. This ensures consistent proxy handling. For more information, refer to Proxy settings for EDOT SDKs.