Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META 786] Do not use proxy when querying cloud metadata from APM agents #1806

Open
elastic-apm-tech opened this issue Apr 19, 2023 · 1 comment
Assignees
Milestone

Comments

@elastic-apm-tech
Copy link

See meta issue for the description and details:

@beniwohli
Copy link
Contributor

beniwohli commented Apr 19, 2023

It looks like we're already doing this, by coincidence. We create separate connection pools where we fetch the cloud metadata:

http = urllib3.PoolManager()

http = urllib3.PoolManager()

http = urllib3.PoolManager()

In contrast, the connection pool used in the transport explicitly sets up a ProxyManager if the HTTP[S]_PROXY environment variable is set.

proxies = getproxies_environment()
proxy_url = proxies.get("https", proxies.get("http", None))
if proxy_url and not proxy_bypass_environment(url_parts.netloc):
self._http = urllib3.ProxyManager(proxy_url, **self._pool_kwargs)
else:
self._http = urllib3.PoolManager(**self._pool_kwargs)

@basepi agree to close this as completed? Or should we add comments in utils/cloud.py to not use ProxyManager there, just in case?

@estolfo estolfo added this to the 8.9 milestone Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants