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

metricdog: respect proxy settings #1322

Merged
merged 2 commits into from
Feb 22, 2021
Merged

metricdog: respect proxy settings #1322

merged 2 commits into from
Feb 22, 2021

Conversation

webern
Copy link
Contributor

@webern webern commented Feb 15, 2021

Issue number:

#1298

Description of changes:

Use the proxy.env file to give proxy values to metricdog.

A second commit provides a workaround for seanmonstar/reqwest#1176

Testing done:

  • Set metricdog's timer to send every 30 seconds
  • Created a tinyproxy near Bottlerocket at 192.168.57.178:8888 and set network.https-proxy to this value.
  • Started Bottlerocket, observed metricdog using the tinyproxy.
  • Used apiclient to set network.no-proxy to ["metrics.bottlerocket.aws"], observed the metricdog pings stopped arriving at the tinyproxy.
  • Used apiclient to set network.no-proxy to [], observed the metricdog pings start arriving at the tinyproxy again.
  • Started a new Bottlerocket instance without setting network.https-proxy (this value cannot be unset once it has been set). Observed that metricdog pings were working.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@webern webern changed the title metricdog: observe HTTPS_PROXY metricdog: resdpect proxy settings Feb 16, 2021
@webern webern marked this pull request as ready for review February 16, 2021 02:41
@webern webern changed the title metricdog: resdpect proxy settings metricdog: respect proxy settings Feb 16, 2021
@webern
Copy link
Contributor Author

webern commented Feb 18, 2021

webern force-pushed the webern:metricdog-proxy branch from 2aea5ac to e468d0a

Link TODO to a tracking issue

@webern
Copy link
Contributor Author

webern commented Feb 19, 2021

webern force-pushed the webern:metricdog-proxy branch from e468d0a to 8e20623

Rebase.

@bcressey
Copy link
Contributor

Started a new Bottlerocket instance without setting network.https-proxy (this value cannot be unset once it has been set).

Is this something we should fix?

@webern
Copy link
Contributor Author

webern commented Feb 21, 2021

Started a new Bottlerocket instance without setting network.https-proxy (this value cannot be unset once it has been set).

Is this something we should fix?

Probably. It's not specific to proxy settings. A map key cannot be removed with the API.

Use the proxy.env file to give HTTPS_PROXY and NO_PROXY values to
metricdog. metricdog's HTTP client automatically picks these up and uses
them.
reqwest does not support HTTPS_PROXY values that are not in URL format
(i.e. if there is no protocol scheme). On Bottlerocket we expect an
HTTPS_PROXY value with no scheme to be treated as http://.

Here we check the HTTPS_PROXY value, and if it has no scheme we reset
the value to prepend https://
@webern
Copy link
Contributor Author

webern commented Feb 22, 2021

webern force-pushed the webern:metricdog-proxy branch from 8e20623 to 9d6b77d

Rebase

@webern webern merged commit 580c179 into bottlerocket-os:develop Feb 22, 2021
@webern webern deleted the metricdog-proxy branch February 22, 2021 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants