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

feat(inputs.prometheus): use system wide proxy settings #11729

Merged
merged 13 commits into from
Sep 13, 2022
Merged

feat(inputs.prometheus): use system wide proxy settings #11729

merged 13 commits into from
Sep 13, 2022

Conversation

erwiese
Copy link
Contributor

@erwiese erwiese commented Aug 26, 2022

resolves #11728

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Aug 26, 2022
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Thanks for taking the time to put up a PR.

In Telegraf, we already have a standard HTTP client config that allows users to set the proxy as a part of their configuration. It would be good to use the same behavior across plugins.

Take a look at the HTTP plugin in how it creates a client with the additional httpconfig.HTTPClientConfig.

As well, we would to add the configuration options for the proxy to the plugin configuration.

@erwiese erwiese requested a review from powersj August 29, 2022 10:28
@erwiese
Copy link
Contributor Author

erwiese commented Sep 2, 2022

Hi, could you already review my changes? or anything else missing?

Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erwiese, your change looks a lot better this way. Thanks for updating the PR! I have one request left to avoid recreating the client over and over. Can you please take a look?

plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Sep 7, 2022
@Hipska
Copy link
Contributor

Hipska commented Sep 9, 2022

Shouldn't the unix socket client stuff also be added to Init in this case? It is also making a new client on each interval + URL. Both (http & unix) can be placed in the same p.client. Furthermore the response_timeout can be deprecated in favour of timeout.

Edit: be careful, It seems there is possibility of mixed types of URLs, some can be http and/or unix..

@erwiese
Copy link
Contributor Author

erwiese commented Sep 12, 2022

@Hipska someone could use unix and http URLs in one call, so I will not touch it. response_time: yes but breaking and not matter of this issue.

@erwiese erwiese requested review from srebhan and powersj and removed request for powersj and srebhan September 12, 2022 12:44
@Hipska
Copy link
Contributor

Hipska commented Sep 12, 2022

response_time could be marked as deprecated and still being used when timeout is not set..

@Hipska Hipska added area/prometheus ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Sep 12, 2022
@Hipska Hipska changed the title feat: use system wide proxy settings for prometheus input plugin feat(inputs/prometheus): use system wide proxy settings Sep 12, 2022
@Hipska Hipska changed the title feat(inputs/prometheus): use system wide proxy settings feat(inputs.prometheus): use system wide proxy settings Sep 12, 2022
@MyaLongmire MyaLongmire merged commit 215e8e0 into influxdata:master Sep 13, 2022
dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use system wide proxy settings for prometheus input plugin
5 participants