Skip to content

Commit 1c16938

Browse files
elastic-observability-automation[bot]carsonipcursoragent
authored
[updatecli][8.19] Update to elastic/beats (#21400)
* chore: update-beats with 8.19 Made with ❤️️ by updatecli * Fix breaking change * fix: switch beat manager startup to pre/post init Replace deprecated manager.Start usage with PreInit and PostInit in beat runtime and tests so lint passes with the bumped beats dependency. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: elastic-observability-automation[bot] <180520183+elastic-observability-automation[bot]@users.noreply.github.com> Co-authored-by: Carson Ip <carson.ip@elastic.co> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3d10d47 commit 1c16938

9 files changed

Lines changed: 155 additions & 573 deletions

File tree

NOTICE-fips.txt

Lines changed: 12 additions & 223 deletions
Large diffs are not rendered by default.

NOTICE.txt

Lines changed: 12 additions & 223 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/dustin/go-humanize v1.0.1
1010
github.com/elastic/apm-aggregation v1.5.1
1111
github.com/elastic/apm-data v1.22.0
12-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260330201428-8b17db95a512
12+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260707190828-8484d9ec0199
1313
github.com/elastic/elastic-agent-client/v7 v7.18.1
1414
github.com/elastic/elastic-agent-libs v0.46.0
1515
github.com/elastic/elastic-agent-system-metrics v0.14.4
@@ -97,7 +97,7 @@ require (
9797
github.com/cockroachdb/swiss v0.0.0-20251224182025-b0f6560f979b // indirect
9898
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
9999
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
100-
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
100+
github.com/cyphar/filepath-securejoin v0.6.0 // indirect
101101
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
102102
github.com/dgraph-io/ristretto v0.2.0 // indirect
103103
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
@@ -111,7 +111,7 @@ require (
111111
github.com/elastic/apm-tools v0.0.0-20250124173757-336011228dbe // indirect
112112
github.com/elastic/go-elasticsearch/v8 v8.19.6 // indirect
113113
github.com/elastic/go-licenser v0.4.2 // indirect
114-
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f // indirect
114+
github.com/elastic/go-lumber v0.2.0 // indirect
115115
github.com/elastic/go-structform v0.0.12 // indirect
116116
github.com/elastic/go-windows v1.0.2 // indirect
117117
github.com/elastic/gobench v0.0.0-20250916092032-bff3bff26845 // indirect
@@ -145,7 +145,7 @@ require (
145145
github.com/goreleaser/chglog v0.6.2 // indirect
146146
github.com/goreleaser/fileglob v1.3.0 // indirect
147147
github.com/goreleaser/nfpm/v2 v2.41.2 // indirect
148-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
148+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
149149
github.com/h2non/filetype v1.1.3 // indirect
150150
github.com/hashicorp/go-hclog v1.6.3 // indirect
151151
github.com/hashicorp/go-plugin v1.6.1 // indirect
@@ -197,14 +197,14 @@ require (
197197
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/core/xidutils v0.156.0 // indirect
198198
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
199199
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
200-
github.com/pierrec/lz4/v4 v4.1.26 // indirect
200+
github.com/pierrec/lz4/v4 v4.1.27 // indirect
201201
github.com/pjbgf/sha1cd v0.3.0 // indirect
202202
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
203203
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
204204
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
205205
github.com/prometheus/client_golang v1.23.2 // indirect
206206
github.com/prometheus/client_model v0.6.2 // indirect
207-
github.com/prometheus/common v0.67.5 // indirect
207+
github.com/prometheus/common v0.68.0 // indirect
208208
github.com/prometheus/procfs v0.20.1 // indirect
209209
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
210210
github.com/rogpeppe/go-internal v1.14.1 // indirect
@@ -245,18 +245,17 @@ require (
245245
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
246246
go.opentelemetry.io/collector/featuregate v1.62.0 // indirect
247247
go.uber.org/multierr v1.11.0 // indirect
248-
go.yaml.in/yaml/v2 v2.4.4 // indirect
249248
golang.org/x/crypto v0.53.0 // indirect
250-
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
249+
golang.org/x/exp v0.0.0-20260527015227-08cc5374adb3 // indirect
251250
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
252251
golang.org/x/mod v0.36.0 // indirect
253252
golang.org/x/sys v0.46.0 // indirect
254253
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 // indirect
255254
golang.org/x/text v0.38.0 // indirect
256255
golang.org/x/tools v0.45.0 // indirect
257256
golang.org/x/tools/go/vcs v0.1.0-deprecated // indirect
258-
google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 // indirect
259-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect
257+
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
258+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
260259
gopkg.in/ini.v1 v1.67.0 // indirect
261260
gopkg.in/warnings.v0 v0.1.2 // indirect
262261
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

Lines changed: 102 additions & 104 deletions
Large diffs are not rendered by default.

internal/beatcmd/beat.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,10 @@ func (b *Beat) Run(ctx context.Context) error {
427427
g.Go(func() error { return reloader.Run(ctx) })
428428

429429
b.Manager.SetStopCallback(cancel)
430-
if err := b.Manager.Start(); err != nil {
430+
if err := b.Manager.PreInit(); err != nil {
431431
return fmt.Errorf("failed to start manager: %w", err)
432432
}
433+
b.Manager.PostInit()
433434
defer b.Manager.Stop()
434435
} else {
435436
if !b.Config.Output.IsSet() {

internal/beatcmd/beat_test.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ func TestRunManager_Reloader(t *testing.T) {
522522
}, registry, client, logptest.NewTestingLogger(t, ""), xpacklbmanagement.WithChangeDebounce(0))
523523
require.NoError(t, err)
524524

525-
err = manager.Start()
525+
err = manager.PreInit()
526+
manager.PostInit()
526527
require.NoError(t, err)
527528
defer manager.Stop()
528529

@@ -625,7 +626,8 @@ func TestRunManager_Reloader_newRunnerError(t *testing.T) {
625626
}, registry, client, logptest.NewTestingLogger(t, ""), xpacklbmanagement.WithChangeDebounce(0))
626627
require.NoError(t, err)
627628

628-
err = manager.Start()
629+
err = manager.PreInit()
630+
manager.PostInit()
629631
require.NoError(t, err)
630632

631633
select {
@@ -729,10 +731,21 @@ func (m *mockManager) Enabled() bool {
729731
}
730732

731733
func (m *mockManager) Start() error {
734+
if err := m.PreInit(); err != nil {
735+
return err
736+
}
737+
m.PostInit()
738+
return nil
739+
}
740+
741+
func (m *mockManager) PreInit() error {
732742
close(m.started)
733743
return nil
734744
}
735745

746+
func (m *mockManager) PostInit() {
747+
}
748+
736749
func (m *mockManager) Stop() {
737750
close(m.stopped)
738751
}

internal/beatcmd/testcmd.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222

2323
"github.com/spf13/cobra"
2424

25-
"github.com/elastic/elastic-agent-libs/paths"
26-
2725
"github.com/elastic/beats/v7/libbeat/outputs"
2826
"github.com/elastic/elastic-agent-libs/config"
2927
"github.com/elastic/elastic-agent-libs/logp"
@@ -77,7 +75,7 @@ func newTestOutputCommand(beatParams BeatParams) *cobra.Command {
7775
}
7876
indexSupporter := idxmgmt.NewSupporter(beat.Info.Logger, beat.rawConfig)
7977
output, err := outputs.Load(
80-
indexSupporter, beat.Info, nil, beat.Config.Output.Name(), beat.Config.Output.Config(), paths.New(),
78+
indexSupporter, beat.Info, nil, beat.Config.Output.Name(), beat.Config.Output.Config(),
8179
)
8280
if err != nil {
8381
return fmt.Errorf("error initializing output: %w", err)

internal/beater/beater.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ import (
4444
"google.golang.org/grpc"
4545
_ "google.golang.org/grpc/encoding/gzip"
4646

47-
"github.com/elastic/elastic-agent-libs/paths"
48-
4947
"github.com/elastic/beats/v7/libbeat/beat"
5048
"github.com/elastic/beats/v7/libbeat/esleg/eslegclient"
5149
"github.com/elastic/beats/v7/libbeat/instrumentation"
@@ -885,7 +883,7 @@ func (s *Runner) newLibbeatFinalBatchProcessor(
885883
}
886884
indexSupporter := idxmgmt.NewSupporter(logger, s.rawConfig)
887885
outputName := s.outputConfig.Name()
888-
output, err := outputs.Load(indexSupporter, beatInfo, stats, outputName, s.outputConfig.Config(), paths.New())
886+
output, err := outputs.Load(indexSupporter, beatInfo, stats, outputName, s.outputConfig.Config())
889887
return outputName, output, err
890888
}
891889
var pipelineConfig pipeline.Config
@@ -1073,6 +1071,6 @@ func (nopProcessingSupporter) Processors() []string {
10731071
return nil
10741072
}
10751073

1076-
func (s nopProcessingSupporter) Create(cfg beat.ProcessingConfig, _ bool, _ *paths.Path) (beat.Processor, error) {
1074+
func (s nopProcessingSupporter) Create(cfg beat.ProcessingConfig, _ bool) (beat.Processor, error) {
10771075
return cfg.Processor, nil
10781076
}

internal/publish/pub_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ import (
3131
"github.com/stretchr/testify/assert"
3232
"github.com/stretchr/testify/require"
3333

34-
"github.com/elastic/elastic-agent-libs/paths"
35-
3634
"go.elastic.co/apm/v2/apmtest"
3735
"go.elastic.co/fastjson"
3836

@@ -161,7 +159,6 @@ func BenchmarkPublisher(b *testing.B) {
161159
config.MustNewConfigFrom(map[string]interface{}{
162160
"hosts": []interface{}{srv.URL},
163161
}),
164-
paths.New(),
165162
)
166163
require.NoError(b, err)
167164
conf, err := config.NewConfigFrom(map[string]interface{}{

0 commit comments

Comments
 (0)