-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: Use HTTPClientConfig struct in elastic stack plugins #14207
feat: Use HTTPClientConfig struct in elastic stack plugins #14207
Conversation
Enable elasticsearch, elasticsearch_query, kibana, and logstash plugins to use environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions) in order to connect through a proxy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @oserde! We cannot accept the PR in the current form as it may break users that have the environment variables set but are connecting to one of the inputs without proxy. That might e.g. be the case if the server is in a local network but the proxy is required for internet access.
In my view the best way would be to switch the plugins to use the HTTPClientConfig
structure using the proxy.HTTPProxy
implementation exposing a use_system_proxy
setting.
Do you think you can modify the PR in this way?
Hi @srebhan , Thanks for the feedback! I think your suggestions make a lot of sense. I will implement those changes, test the plugins and get back to you. |
HTTPClientConfig structure is a generic way of configuring HTTPconnections and it is already used by other plugins. It supports many HTTP options, including the ability to set HTTP proxies at input level. Config option `http_timeout` has been deprecated for elasticsearch plugin, as `timeout` and `response_timeout` options already cover its function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the update @oserde! Just one question...
Timeout setting had been removed from plugins because default value in httpconfig.HTTPClientConfig struct currently coincides with the timeout that these plugins set. By setting default timeout at plugin level we avoid depending on default values from httpconfig.HTTPClientConfig struct
As dev guidelines suggest, a deprecated message should also be included in sample config
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
Thanks for your suggestions! @Hipska |
@oserde please check the test/compile errors... |
Fixed! |
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @oserde!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Enable elasticsearch, elasticsearch_query, kibana, and logstash plugins to use environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions) in order to connect through a proxy
resolves #14206
Adds Proxy to Transport struct, as in many other plugins.