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

[7.14](backport #25219) Introduce httpcommon package in libbeat (add support for Proxy) #26949

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d

- Bundle synthetics deps with heartbeat docker image. {pull}23274[23274]
- Add support for `copytruncate` method when rotating input logs with an external tool in `filestream` input. {pull}23457[23457]
- Add mime type detection for http responses. {pull}22976[22976]
- Add `proxy_headers` to HTTP monitor. {pull}25219[25219]

*Heartbeat*
Expand Down
3 changes: 3 additions & 0 deletions libbeat/monitoring/report/elasticsearch/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import (
"time"

"github.com/elastic/beats/v7/libbeat/common/transport/httpcommon"
<<<<<<< HEAD
"github.com/elastic/beats/v7/libbeat/monitoring/report"
=======
>>>>>>> 4accfa821 (Introduce httpcommon package in libbeat (add support for Proxy) (#25219))
)

// config is subset of libbeat/outputs/elasticsearch config tailored
Expand Down
31 changes: 31 additions & 0 deletions metricbeat/module/elasticsearch/index/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ import (

"github.com/stretchr/testify/require"

<<<<<<< HEAD
=======
"github.com/elastic/beats/v7/libbeat/common/transport/httpcommon"
"github.com/elastic/beats/v7/metricbeat/helper"
"github.com/elastic/beats/v7/metricbeat/mb"
>>>>>>> 4accfa821 (Introduce httpcommon package in libbeat (add support for Proxy) (#25219))
mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing"
"github.com/elastic/beats/v7/metricbeat/module/elasticsearch"
)
Expand All @@ -35,7 +41,32 @@ var info = elasticsearch.Info{
}

func TestMapper(t *testing.T) {
<<<<<<< HEAD
elasticsearch.TestMapperWithInfo(t, "../index/_meta/test/stats.*.json", eventsMapping)
=======
t.Skip("Skipping to fix in a follow up")

mux := createEsMuxer("7.6.0", "platinum", false)

server := httptest.NewServer(mux)
defer server.Close()

httpClient, err := helper.NewHTTPFromConfig(helper.Config{
ConnectTimeout: 30 * time.Second,
Transport: httpcommon.HTTPTransportSettings{
Timeout: 30 * time.Second,
},
}, mb.HostData{
URI: server.URL,
SanitizedURI: server.URL,
Host: server.URL,
})
if err != nil {
t.Fatal(err)
}

elasticsearch.TestMapperWithHttpHelper(t, "../index/_meta/test/stats.*.json", httpClient, eventsMapping)
>>>>>>> 4accfa821 (Introduce httpcommon package in libbeat (add support for Proxy) (#25219))
}

func TestEmpty(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,7 @@
- Set `agent.id` to the Fleet Agent ID in events published from inputs backed by Beats. {issue}21121[21121] {pull}26394[26394] {pull}26548[26548]
- Add proxy support to artifact downloader and communication with fleet server. {pull}25219[25219]
- Add proxy support to enroll command. {pull}26514[26514]
- Set `agent.id` to the Fleet Agent ID in events published from inputs backed by Beats. {issue}21121[21121] {pull}26394[26394]
- Add proxy support to artifact downloader and communication with fleet server. {pull}25219[25219]
- Enable configuring monitoring namespace {issue}26439[26439]
- Communicate with Fleet Server over HTTP2. {pull}26474[26474]
6 changes: 6 additions & 0 deletions x-pack/elastic-agent/pkg/agent/cmd/enroll_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (e *enrollCmdOption) remoteConfig() (remote.Config, error) {
}
if e.Insecure {
tlsCfg.VerificationMode = tlscommon.VerifyNone
<<<<<<< HEAD
}

cfg.Transport.TLS = &tlsCfg
Expand All @@ -146,6 +147,11 @@ func (e *enrollCmdOption) remoteConfig() (remote.Config, error) {
Headers: headers,
}

=======
}

cfg.Transport.TLS = &tlsCfg
>>>>>>> 4accfa821 (Introduce httpcommon package in libbeat (add support for Proxy) (#25219))
return cfg, nil
}

Expand Down