Introduce httpcommon package in libbeat (add support for Proxy)#25219
Merged
urso merged 46 commits intoelastic:masterfrom Jun 29, 2021
Merged
Introduce httpcommon package in libbeat (add support for Proxy)#25219urso merged 46 commits intoelastic:masterfrom
urso merged 46 commits intoelastic:masterfrom
Conversation
added 14 commits
April 16, 2021 23:35
Contributor
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
Contributor
|
This is a super great start! cc @mostlyjason @alvarolobato |
Author
|
Argh... I forgot to adapt legacy Central Managent support and broke the build :( |
added 3 commits
April 22, 2021 17:34
added 2 commits
June 29, 2021 10:30
Contributor
|
http2 change with fallback looks good |
blakerouse
reviewed
Jun 29, 2021
Author
|
/test |
blakerouse
reviewed
Jun 29, 2021
| @@ -142,7 +139,7 @@ func NewWithConfig(log *logger.Logger, cfg Config, wrapper wrapperFunc) (*Client | |||
|
|
|||
| httpClient := http.Client{ | |||
Contributor
There was a problem hiding this comment.
Does this need to be http2.Client? Or will the httpcommon.WithForceAttepmtHTTP2(true) switch it to http2 transparently?
Author
There was a problem hiding this comment.
the net/http package can upgrade to http2. HTTP 1 or 2 is handled by the transport.
mergify bot
pushed a commit
that referenced
this pull request
Jun 29, 2021
(cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go
mdelapenya
added a commit
to mdelapenya/beats
that referenced
this pull request
Jun 30, 2021
* master: (25 commits) fix: Force PLATFORMS environment variable when we build Elastic Agent dependencies on arm64 (elastic#26415) macos for metricbeat to run in the extended meta-stage (elastic#26573) Packaging: add arm7 platform in the main pipeline (elastic#26575) [Heartbeat] Skip flakey timer queue test (elastic#26592) Update to "read_pipeline" permission (elastic#26465) (elastic#26580) API keys do not reflect the need for read_pipeline (elastic#26466) (elastic#26582) Add Fleet agent.id to Agent monitoring data (elastic#26548) Add kinesis metricset (elastic#25989) Refactor of system/memory metricset (elastic#26334) Introduce httpcommon package in libbeat (add support for Proxy) (elastic#25219) [Filebeat] change multiline configuration in awss3 input to parsers (elastic#25873) docs: Hint for the error "Error extracting container id" (elastic#25824) [Docs] Fixed metricbeat redis exported field CPU descriptions (elastic#25846) (elastic#26496) Update urllib to 1.26.5. (elastic#26380) Update golang.org/x/crypto (elastic#26448) [Filebeat] Update Fortinet Ingest Pipeline (elastic#24816) Move parsers outside of filestream input so others can use them as well (elastic#26541) [Filebeat] Fix `threatintel.indicator.url.full` field not populating (elastic#26508) [Filebeat] Add network direction processor to Zeek and Suricata modules (elastic#24620) Logging code cleanup related to Nomad auto-discovery (elastic#26498) ...
blakerouse
added a commit
that referenced
this pull request
Jun 30, 2021
…upport for Proxy) (#26587) * Introduce httpcommon package in libbeat (add support for Proxy) (#25219) (cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go * Fix issues with backport. * Fix changelog. * FIx integration tests for ml-importer. Co-authored-by: Steffen Siering <steffen.siering@elastic.co> Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
mergify bot
added a commit
that referenced
this pull request
Jun 30, 2021
…upport for Proxy) (#26587) * Introduce httpcommon package in libbeat (add support for Proxy) (#25219) (cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go * Fix issues with backport. * Fix changelog. * FIx integration tests for ml-importer. Co-authored-by: Steffen Siering <steffen.siering@elastic.co> Co-authored-by: Blake Rouse <blake.rouse@elastic.co> (cherry picked from commit 37e37f1)
blakerouse
added a commit
to blakerouse/beats
that referenced
this pull request
Jun 30, 2021
… (add support for Proxy) (elastic#26587) * Introduce httpcommon package in libbeat (add support for Proxy) (elastic#25219) (cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go * Fix issues with backport. * Fix changelog. * FIx integration tests for ml-importer. Co-authored-by: Steffen Siering <steffen.siering@elastic.co> Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse
added a commit
that referenced
this pull request
Jun 30, 2021
…upport for Proxy) (#26587) (#26626) * Introduce httpcommon package in libbeat (add support for Proxy) (#25219) (cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go * Fix issues with backport. * Fix changelog. * FIx integration tests for ml-importer. Co-authored-by: Steffen Siering <steffen.siering@elastic.co> Co-authored-by: Blake Rouse <blake.rouse@elastic.co> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Steffen Siering <steffen.siering@elastic.co>
simitt
added a commit
to simitt/apm-server
that referenced
this pull request
Jun 30, 2021
simitt
added a commit
to simitt/apm-server
that referenced
this pull request
Jun 30, 2021
simitt
added a commit
to simitt/apm-server
that referenced
this pull request
Jun 30, 2021
axw
added a commit
to elastic/apm-server
that referenced
this pull request
Jul 1, 2021
* Revert "[7.x] Update to elastic/beats@2871d29be93a (backport #5454) (#5589)" This reverts commit 4269aee. * Update go version to 1.16.5 * Update to elastic/beats@9361be46ebf2 * update tests to new ecs version * fix broken test due to elastic/beats#25219 * update python tests to new ecs version * make update Co-authored-by: Andrew Wilkins <axw@elastic.co>
mergify bot
pushed a commit
that referenced
this pull request
Jul 19, 2021
(cherry picked from commit 4accfa8) # Conflicts: # libbeat/monitoring/report/elasticsearch/config.go # metricbeat/module/elasticsearch/index/data_test.go # x-pack/elastic-agent/pkg/agent/cmd/enroll_cmd.go
This was referenced Jul 20, 2021
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
We introduces a libbeat/common/transport/httpcommon package. The package provides structures that can be used to extract common http settings from a configuration object and construct a
http.RoundTripperor ahttp.Client. Currently the types configure:The
HTTPTransportSettingsandHTTPClientProxySettingsimplement Unpack, which will be used automatically when a configuration is unpacked into a configuration structure. TheUnpackerimplemetnations directly initialize TLS and parse URLs and other settings that can fail. If some setting is missconfigured, Beats will fail early, reporting the full path of the setting (input, output, ...) that was missconfigured. Initializing the proxy URL and TLS, also reduces the responsiblities for the inputs/outputs to provide copy and paste code to do so.Example usage:
Features already provided by httpcommon:
http.DefaultTransport. This initializes the idle connection limit and idle connection timeout (don't leak connections).By default (can be disabled via functional options), proxy support defaults to the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables. The environment variables are automatically ignored if the URLs host is localhost or the loopback device (by IP).
Many features that use an
http.Clienthave been update to use thehttpcommonpackage in order to extract "common" setting (this list only documents changes on existing features):httpmonitor:setup.kibana.*namespace):httpjsoninput:cloudfoundry:remote.Config, which is also used fleet server config namespaceMissing (left over for follow up PRs):
httpcommonpackageWhy is it important?
The change improves consistency between different features that use HTTP. Plus the common copy and past boilerplate is removed and concentrated in a single place.
All Features that use HTTP will gain proxy support.
More APM HTTP instrumentation for HTTP based features.
Checklist
- [ ] I have made corresponding changes to the documentation- [ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Setup an HTTP proxy and try to connect via said proxy:
Related issues
HTTP_PROXY#25021 [Fleet] Add support for proxy in Elastic Agent #25319proxy_urlto the dashboard setup task #8276