apm-agent-python
apm-agent-python copied to clipboard
[META 786] Do not use proxy when querying cloud metadata from APM agents
See meta issue for the description and details:
- Meta issue: https://github.com/elastic/apm/issues/786
It looks like we're already doing this, by coincidence. We create separate connection pools where we fetch the cloud metadata:
https://github.com/elastic/apm-agent-python/blob/d19c5ff5c0de0dc526d59e7e044194da37f36f2b/elasticapm/utils/cloud.py#L43 https://github.com/elastic/apm-agent-python/blob/d19c5ff5c0de0dc526d59e7e044194da37f36f2b/elasticapm/utils/cloud.py#L95 https://github.com/elastic/apm-agent-python/blob/d19c5ff5c0de0dc526d59e7e044194da37f36f2b/elasticapm/utils/cloud.py#L134
In contrast, the connection pool used in the transport explicitly sets up a ProxyManager if the HTTP[S]_PROXY environment variable is set.
https://github.com/elastic/apm-agent-python/blob/d19c5ff5c0de0dc526d59e7e044194da37f36f2b/elasticapm/transport/http.py#L124-L129
@basepi agree to close this as completed? Or should we add comments in utils/cloud.py to not use ProxyManager there, just in case?