Skip to content

Commit d6d1394

Browse files
[updatecli][8.18] Update to elastic/beats (#18253)
* chore: update-beats with 8.18 Made with ❤️️ by updatecli * chore: update-beats with 8.18 Made with ❤️️ by updatecli * chore: update-beats with 8.18 Made with ❤️️ by updatecli * chore: update-beats with 8.18 Made with ❤️️ by updatecli * lint: update for beat logger changes --------- Co-authored-by: elastic-observability-automation[bot] <180520183+elastic-observability-automation[bot]@users.noreply.github.com> Co-authored-by: kruskal <99559985+kruskall@users.noreply.github.com>
1 parent 9fb426c commit d6d1394

28 files changed

+90
-64
lines changed

NOTICE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/apm-data@v1.16.
604604

605605
--------------------------------------------------------------------------------
606606
Dependency : github.com/elastic/beats/v7
607-
Version: v7.0.0-alpha2.0.20250819144645-c252dc5e63a7
607+
Version: v7.0.0-alpha2.0.20250822184927-d95857e4319b
608608
Licence type (autodetected): Elastic
609609
--------------------------------------------------------------------------------
610610

611-
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20250819144645-c252dc5e63a7/LICENSE.txt:
611+
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/v7@v7.0.0-alpha2.0.20250822184927-d95857e4319b/LICENSE.txt:
612612

613613
Source code in this repository is variously licensed under the Apache License
614614
Version 2.0, an Apache compatible license, or the Elastic License. Outside of
@@ -860,11 +860,11 @@ SOFTWARE
860860

861861
--------------------------------------------------------------------------------
862862
Dependency : github.com/elastic/elastic-agent-libs
863-
Version: v0.20.0
863+
Version: v0.21.5
864864
Licence type (autodetected): Apache-2.0
865865
--------------------------------------------------------------------------------
866866

867-
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.20.0/LICENSE:
867+
Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-libs@v0.21.5/LICENSE:
868868

869869
Apache License
870870
Version 2.0, January 2004

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ require (
99
github.com/dustin/go-humanize v1.0.1
1010
github.com/elastic/apm-aggregation v1.2.0
1111
github.com/elastic/apm-data v1.16.0
12-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250819144645-c252dc5e63a7
12+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250822184927-d95857e4319b
1313
github.com/elastic/elastic-agent-client/v7 v7.17.0
14-
github.com/elastic/elastic-agent-libs v0.20.0
14+
github.com/elastic/elastic-agent-libs v0.21.5
1515
github.com/elastic/elastic-agent-system-metrics v0.11.11
1616
github.com/elastic/gmux v0.3.2
1717
github.com/elastic/go-docappender/v2 v2.6.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ github.com/elastic/apm-perf v0.0.0-20250207152505-1dbeb202ff22 h1:br+XeQOcxNFSv+
185185
github.com/elastic/apm-perf v0.0.0-20250207152505-1dbeb202ff22/go.mod h1:gE+FV7xXv0/nBenviCvpvnvTpUkjJXtuOWs2UT+ZRtw=
186186
github.com/elastic/apm-tools v0.0.0-20250124173757-336011228dbe h1:LDtn/A8Tsfz8DQlbXtmDud9ha9oOGriwJGB7V0Ozik8=
187187
github.com/elastic/apm-tools v0.0.0-20250124173757-336011228dbe/go.mod h1:SIlGcpTnnosxZ3OvoRC7ADxhHdlsu/nwUdVMF9OkgYc=
188-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250819144645-c252dc5e63a7 h1:6x+pZgyiAJIPo3+Ycq4A+OLu7SthQP4wmtEYO34LFfs=
189-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250819144645-c252dc5e63a7/go.mod h1:bOMTzmIxd4Q8BVdrnTnEFf3yCPEVi5vcqIPXltu9e/o=
188+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250822184927-d95857e4319b h1:NkVssWC8p9qLacv11rwo8Ma4a6N1dk+N+iYQkbZre9o=
189+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250822184927-d95857e4319b/go.mod h1:hhuz80m1xuyCOQmSFFNydvf19v4SjlXycnzGD1o3cgM=
190190
github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0JojNasPgYIA47gpuuns=
191191
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
192192
github.com/elastic/elastic-agent-client/v7 v7.17.0 h1:TPLrEHF4kJ3RkmQzZPffrniY4WeW4vriHZbOAzM1hFo=
193193
github.com/elastic/elastic-agent-client/v7 v7.17.0/go.mod h1:6h+f9QdIr3GO2ODC0Y8+aEXRwzbA5W4eV4dd/67z7nI=
194-
github.com/elastic/elastic-agent-libs v0.20.0 h1:MPjenwuEr+QfMeQRV4BK817ZbiNS38SXJE7QGHDwhUs=
195-
github.com/elastic/elastic-agent-libs v0.20.0/go.mod h1:1HNxREH8C27kGrJCtKZh/ot8pV8joH8VREP21+FrH5s=
194+
github.com/elastic/elastic-agent-libs v0.21.5 h1:YTMwaBPgOPvQnxBPv7fLpUqjw2HgY3ymC9TwdzdOD8U=
195+
github.com/elastic/elastic-agent-libs v0.21.5/go.mod h1:xSeIP3NtOIT4N2pPS4EyURmS1Q8mK0lWZ8Wd1Du6q3w=
196196
github.com/elastic/elastic-agent-system-metrics v0.11.11 h1:Qjh3Zef23PfGlG91AF+9ciNLNQf/8cDJ4CalnLZtV3g=
197197
github.com/elastic/elastic-agent-system-metrics v0.11.11/go.mod h1:GNqmKfvOt8PwORjbS6GllNdMfkLpOWyTa7P8oQq4E5o=
198198
github.com/elastic/elastic-transport-go/v8 v8.6.1 h1:h2jQRqH6eLGiBSN4eZbQnJLtL4bC5b4lfVFRjw2R4e4=

internal/agentcfg/elasticsearch_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"go.elastic.co/apm/v2/apmtest"
3333

3434
"github.com/elastic/apm-server/internal/elasticsearch"
35+
"github.com/elastic/elastic-agent-libs/logp/logptest"
3536
)
3637

3738
var sampleHits = []map[string]interface{}{
@@ -48,7 +49,7 @@ func newMockElasticsearchClient(t testing.TB, handler func(http.ResponseWriter,
4849
config := elasticsearch.DefaultConfig()
4950
config.Backoff.Init = time.Nanosecond
5051
config.Hosts = []string{srv.URL}
51-
client, err := elasticsearch.NewClient(config)
52+
client, err := elasticsearch.NewClient(config, logptest.NewTestingLogger(t, ""))
5253
require.NoError(t, err)
5354
return client
5455
}

internal/beatcmd/apikey.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/spf13/cobra"
3333

3434
agentconfig "github.com/elastic/elastic-agent-libs/config"
35+
"github.com/elastic/elastic-agent-libs/logp"
3536

3637
"github.com/elastic/apm-server/internal/beater/config"
3738
"github.com/elastic/apm-server/internal/beater/headers"
@@ -236,7 +237,7 @@ func bootstrap() (*es.Client, *config.Config, error) {
236237
if err != nil {
237238
return nil, nil, err
238239
}
239-
client, err := es.NewClient(beaterConfig.AgentAuth.APIKey.ESConfig)
240+
client, err := es.NewClient(beaterConfig.AgentAuth.APIKey.ESConfig, logp.NewLogger(""))
240241
if err != nil {
241242
return nil, nil, err
242243
}
@@ -405,7 +406,7 @@ func invalidateAPIKey(client *es.Client, id string, name string, asJSON bool) er
405406
}
406407

407408
func verifyAPIKey(config *config.Config, privileges []es.PrivilegeAction, credentials string, asJSON bool) error {
408-
authenticator, err := auth.NewAuthenticator(config.AgentAuth)
409+
authenticator, err := auth.NewAuthenticator(config.AgentAuth, logp.NewLogger(""))
409410
if err != nil {
410411
return err
411412
}

internal/beater/api/mux_intake_rum_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestOPTIONS(t *testing.T) {
4343

4444
cfg := cfgEnabledRUM()
4545
cfg.RumConfig.AllowOrigins = []string{"*"}
46-
authenticator, _ := auth.NewAuthenticator(cfg.AgentAuth)
46+
authenticator, _ := auth.NewAuthenticator(cfg.AgentAuth, logptest.NewTestingLogger(t, ""))
4747

4848
h, _ := middleware.Wrap(
4949
func(c *request.Context) {

internal/beater/api/mux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ type muxBuilder struct {
159159
func (m muxBuilder) build(cfg *config.Config) (http.Handler, error) {
160160
nopBatchProcessor := modelpb.ProcessBatchFunc(func(context.Context, *modelpb.Batch) error { return nil })
161161
ratelimitStore, _ := ratelimit.NewStore(1000, 1000, 1000)
162-
authenticator, _ := auth.NewAuthenticator(cfg.AgentAuth)
162+
authenticator, _ := auth.NewAuthenticator(cfg.AgentAuth, logp.NewLogger(""))
163163
return NewMux(
164164
cfg,
165165
nopBatchProcessor,

internal/beater/auth/anonymous_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828

2929
"github.com/elastic/apm-server/internal/beater/auth"
3030
"github.com/elastic/apm-server/internal/beater/config"
31+
"github.com/elastic/elastic-agent-libs/logp/logptest"
3132
)
3233

3334
func TestAnonymousAuthorizer(t *testing.T) {
@@ -132,7 +133,7 @@ func getAnonymousAuthorizer(t testing.TB, cfg config.AnonymousAgentAuth) auth.Au
132133
authenticator, err := auth.NewAuthenticator(config.AgentAuth{
133134
SecretToken: "whatever", // required to enable anonymous auth
134135
Anonymous: cfg,
135-
})
136+
}, logptest.NewTestingLogger(t, ""))
136137
require.NoError(t, err)
137138
_, authorizer, err := authenticator.Authenticate(context.Background(), "", "")
138139
require.NoError(t, err)

internal/beater/auth/apikey_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/elastic/apm-server/internal/beater/config"
3232
"github.com/elastic/apm-server/internal/beater/headers"
3333
"github.com/elastic/apm-server/internal/elasticsearch"
34+
"github.com/elastic/elastic-agent-libs/logp/logptest"
3435
)
3536

3637
func TestAPIKeyAuthorizer(t *testing.T) {
@@ -51,7 +52,7 @@ func TestAPIKeyAuthorizer(t *testing.T) {
5152
esConfig := elasticsearch.DefaultConfig()
5253
esConfig.Hosts = elasticsearch.Hosts{srv.URL}
5354
apikeyAuthConfig := config.APIKeyAgentAuth{Enabled: true, LimitPerMin: 1, ESConfig: esConfig}
54-
authenticator, err := NewAuthenticator(config.AgentAuth{APIKey: apikeyAuthConfig})
55+
authenticator, err := NewAuthenticator(config.AgentAuth{APIKey: apikeyAuthConfig}, logptest.NewTestingLogger(t, ""))
5556
require.NoError(t, err)
5657

5758
credentials := base64.StdEncoding.EncodeToString([]byte("valid_id:key_value"))

internal/beater/auth/authenticator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/elastic/apm-server/internal/beater/config"
2828
"github.com/elastic/apm-server/internal/beater/headers"
2929
"github.com/elastic/apm-server/internal/elasticsearch"
30+
"github.com/elastic/elastic-agent-libs/logp"
3031
)
3132

3233
// Method identifies an authentication and authorization method.
@@ -140,7 +141,7 @@ type APIKeyAuthenticationDetails struct {
140141

141142
// NewAuthenticator creates an Authenticator with config, authenticating
142143
// clients with one of the allowed methods.
143-
func NewAuthenticator(cfg config.AgentAuth) (*Authenticator, error) {
144+
func NewAuthenticator(cfg config.AgentAuth, logger *logp.Logger) (*Authenticator, error) {
144145
b := Authenticator{secretToken: cfg.SecretToken}
145146
if cfg.APIKey.Enabled {
146147
// Do not use apm-server's credentials for API Key requests;
@@ -149,7 +150,7 @@ func NewAuthenticator(cfg config.AgentAuth) (*Authenticator, error) {
149150
cfg.APIKey.ESConfig.Username = ""
150151
cfg.APIKey.ESConfig.Password = ""
151152
cfg.APIKey.ESConfig.APIKey = ""
152-
client, err := elasticsearch.NewClient(cfg.APIKey.ESConfig)
153+
client, err := elasticsearch.NewClient(cfg.APIKey.ESConfig, logger)
153154
if err != nil {
154155
return nil, err
155156
}

0 commit comments

Comments
 (0)