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

[Agent] Rename the User-Agent string from Beats Agent to Elastic Agent #17765

Merged
merged 3 commits into from
Apr 17, 2020
Merged
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
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
@@ -18,11 +18,11 @@
- Fixed merge of config {pull}17399[17399]
- Handle abs paths on windows correctly {pull}17461[17461]
- Improved cancellation of agent {pull}17318[17318]
- Rename the User-Agent string from Beats Agent to Elastic Agent. {pull}17765[17765]
- Fix issues when running `mage package` for all the platforms. {pull}17767[17767]
- Remove the kbn-version on each request to the Kibana API. {pull}17764[17764]
- Fixed process spawning on Windows {pull}17751[17751]


==== New features

- Generate index name in a format type-dataset-namespace {pull}16903[16903]
4 changes: 2 additions & 2 deletions x-pack/elastic-agent/pkg/fleetapi/client_test.go
Original file line number Diff line number Diff line change
@@ -76,14 +76,14 @@ func TestHTTPClient(t *testing.T) {
},
))

t.Run("Fleet user agent", withServer(
t.Run("Elastic Agent User-Agent string", withServer(
func(t *testing.T) *http.ServeMux {
msg := `{ message: "hello" }`
mux := http.NewServeMux()
mux.HandleFunc("/echo-hello", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
fmt.Fprintf(w, msg)
require.Equal(t, r.Header.Get("User-Agent"), "Beat Agent v8.0.0")
require.Equal(t, r.Header.Get("User-Agent"), "Elastic Agent v8.0.0")
ph marked this conversation as resolved.
Show resolved Hide resolved
})
return mux
}, func(t *testing.T, host string) {
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/fleetapi/round_trippers.go
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ func (r *FleetUserAgentRoundTripper) RoundTrip(req *http.Request) (*http.Respons
// NewFleetUserAgentRoundTripper returns a FleetUserAgentRoundTripper that actually wrap the
// existing UserAgentRoundTripper with a specific string.
func NewFleetUserAgentRoundTripper(wrapped http.RoundTripper, version string) http.RoundTripper {
const name = "Beat Agent"
const name = "Elastic Agent"
return &FleetUserAgentRoundTripper{
rt: kibana.NewUserAgentRoundTripper(wrapped, name+" v"+version),
}