Skip to content

Commit 7bd645b

Browse files
[updatecli] Update to elastic/beats@9b71f4382c03 (#15507)
* chore: Update to elastic/beats@9b71f4382c03 Made with ❤️️ by updatecli * lint: update failing tests * test: update error message after reloader fix * lint: update failing tests * lint: run go mod tidy --------- Co-authored-by: elastic-observability-automation[bot] <180520183+elastic-observability-automation[bot]@users.noreply.github.com> Co-authored-by: kruskal <[email protected]>
1 parent a3e7297 commit 7bd645b

File tree

6 files changed

+247
-252
lines changed

6 files changed

+247
-252
lines changed

NOTICE.txt

+217-217
Large diffs are not rendered by default.

go.mod

+4-4
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.2.0
1111
github.com/elastic/apm-data v1.16.0
12-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d
12+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03
1313
github.com/elastic/elastic-agent-client/v7 v7.17.0
1414
github.com/elastic/elastic-agent-libs v0.18.2
1515
github.com/elastic/elastic-agent-system-metrics v0.11.7
@@ -28,7 +28,6 @@ require (
2828
github.com/jaegertracing/jaeger v1.64.0
2929
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
3030
github.com/libp2p/go-reuseport v0.4.0
31-
github.com/modern-go/reflect2 v1.0.2
3231
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.116.0
3332
github.com/patrickmn/go-cache v2.1.0+incompatible
3433
github.com/pkg/errors v0.9.1
@@ -89,7 +88,7 @@ require (
8988
github.com/ebitengine/purego v0.8.1 // indirect
9089
github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect
9190
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f // indirect
92-
github.com/elastic/go-structform v0.0.10 // indirect
91+
github.com/elastic/go-structform v0.0.12 // indirect
9392
github.com/elastic/go-windows v1.0.2 // indirect
9493
github.com/elastic/gosigar v0.14.3 // indirect
9594
github.com/elastic/opentelemetry-lib v0.14.0 // indirect
@@ -124,6 +123,7 @@ require (
124123
github.com/mattn/go-isatty v0.0.20 // indirect
125124
github.com/mitchellh/hashstructure v1.1.0 // indirect
126125
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
126+
github.com/modern-go/reflect2 v1.0.2 // indirect
127127
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
128128
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect
129129
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
@@ -157,7 +157,7 @@ require (
157157
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
158158
golang.org/x/sys v0.29.0 // indirect
159159
golang.org/x/text v0.21.0 // indirect
160-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
160+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
161161
gopkg.in/yaml.v2 v2.4.0 // indirect
162162
howett.net/plist v1.0.1 // indirect
163163
)

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH
66
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
77
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
88
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
9-
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.6.0 h1:AAIdAyPkFff6XTct2lQCxOWN/+LnA41S7kIkzKaMbyE=
10-
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.6.0/go.mod h1:noQIdW75SiQFB3mSFJBr4iRRH83S9skaFiBv4C0uEs0=
9+
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 h1:0nGmzwBv5ougvzfGPCO2ljFRHvun57KpNrVCMrlk0ns=
10+
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0/go.mod h1:gYq8wyDgv6JLhGbAU6gg8amCPgQWRE+aCvrV2gyzdfs=
1111
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
1212
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
1313
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -132,8 +132,8 @@ github.com/elastic/apm-aggregation v1.2.0 h1:UndqG3ccBTjyxTqHujBVjcbVLb9qG1clxRc
132132
github.com/elastic/apm-aggregation v1.2.0/go.mod h1:YllYwPYVV27pbuPfjRtQAKo6eSSrh13PZr38RKYd810=
133133
github.com/elastic/apm-data v1.16.0 h1:LkJFoNkadIyqXNo3EMm98J38j9HWDMWUe6F74GaXtJ4=
134134
github.com/elastic/apm-data v1.16.0/go.mod h1:ST2P1yshhN2U3IbBYyn+Ni3VOFTifavNzMfh7E9zLHY=
135-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d h1:f7HWnj35BO90r0gWRz3DFhLL/y8bTQhHASDgY+AAd+4=
136-
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d/go.mod h1:KCqU8Vg/PRlBpjFS0vT6EMLzI16+85md82k/glDEVQ8=
135+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03 h1:z6A5ysZE+JcT8d9JksKTQbUJrLbzA8CMYnYmOc0sGys=
136+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03/go.mod h1:CFo2FS1mW8elnNyw3Klq61X0QqRVrkAM7s17+bt+4Fo=
137137
github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0JojNasPgYIA47gpuuns=
138138
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
139139
github.com/elastic/elastic-agent-client/v7 v7.17.0 h1:TPLrEHF4kJ3RkmQzZPffrniY4WeW4vriHZbOAzM1hFo=
@@ -152,8 +152,8 @@ github.com/elastic/go-elasticsearch/v8 v8.17.0 h1:e9cWksE/Fr7urDRmGPGp47Nsp4/mvN
152152
github.com/elastic/go-elasticsearch/v8 v8.17.0/go.mod h1:lGMlgKIbYoRvay3xWBeKahAiJOgmFDsjZC39nmO3H64=
153153
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f h1:TsPpU5EAwlt7YZoupKlxZ093qTZYdGou3EhfTF1U0B4=
154154
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f/go.mod h1:HHaWnZamYKWsR9/eZNHqRHob8iQDKnchHmmskT/SKko=
155-
github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gnCJPDo1w=
156-
github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
155+
github.com/elastic/go-structform v0.0.12 h1:HXpzlAKyej8T7LobqKDThUw7BMhwV6Db24VwxNtgxCs=
156+
github.com/elastic/go-structform v0.0.12/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
157157
github.com/elastic/go-sysinfo v1.15.0 h1:54pRFlAYUlVNQ2HbXzLVZlV+fxS7Eax49stzg95M4Xw=
158158
github.com/elastic/go-sysinfo v1.15.0/go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk=
159159
github.com/elastic/go-ucfg v0.8.8 h1:54KIF/2zFKfl0MzsSOCGOsZ3O2bnjFQJ0nDJcLhviyk=
@@ -632,8 +632,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
632632
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
633633
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
634634
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
635-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
636-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
635+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY=
636+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
637637
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
638638
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
639639
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=

internal/beatcmd/beat_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,12 @@ func TestRunManager_Reloader_newRunnerError(t *testing.T) {
422422
require.NoError(t, err)
423423
defer manager.Stop()
424424

425-
assert.Equal(t, "failed to load input config: newRunner error", <-inputFailedMsg)
425+
select {
426+
case msg := <-inputFailedMsg:
427+
assert.Equal(t, "failed to load input config: newRunner error", msg)
428+
case <-time.After(10 * time.Second):
429+
t.Fatal("timed out waiting for input failed msg")
430+
}
426431
}
427432

428433
func runBeat(t testing.TB, beat *Beat) (stop func() error) {

internal/beatcmd/reloader.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ import (
2323
"fmt"
2424
"sync"
2525

26-
"github.com/joeshaw/multierror"
2726
"golang.org/x/sync/errgroup"
2827

28+
"github.com/joeshaw/multierror"
29+
2930
"github.com/elastic/beats/v7/libbeat/beat"
3031
"github.com/elastic/beats/v7/libbeat/cfgfile"
3132
"github.com/elastic/beats/v7/libbeat/common/reload"

internal/elasticsearch/config_test.go

+10-21
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ import (
2626
"strings"
2727
"testing"
2828

29-
// Imported to ensure the type data is available for reflection.
30-
_ "github.com/elastic/beats/v7/libbeat/outputs/elasticsearch"
29+
libbeates "github.com/elastic/beats/v7/libbeat/outputs/elasticsearch"
3130

32-
"github.com/modern-go/reflect2"
3331
"github.com/stretchr/testify/assert"
3432
"github.com/stretchr/testify/require"
3533
)
@@ -101,31 +99,22 @@ func TestAddresses(t *testing.T) {
10199
// TestBeatsConfigSynced helps ensure that our elasticsearch.Config struct is
102100
// kept in sync with the config defined in libbeat/outputs/elasticsearch.
103101
func TestBeatsConfigSynced(t *testing.T) {
104-
libbeatType, _ := reflect2.TypeByPackageName(
105-
"github.com/elastic/beats/v7/libbeat/outputs/elasticsearch",
106-
"elasticsearchConfig",
107-
).(reflect2.StructType)
108-
require.NotNil(t, libbeatType)
109-
110-
localType, _ := reflect2.TypeByPackageName(
111-
"github.com/elastic/apm-server/internal/elasticsearch",
112-
"Config",
113-
).(reflect2.StructType)
114-
require.NotNil(t, localType)
102+
libbeatType := reflect.TypeOf(libbeates.ElasticsearchConfig{})
103+
localType := reflect.TypeOf(Config{})
115104

116105
type structField struct {
117-
reflect2.StructField
106+
reflect.StructField
118107
structTag reflect.StructTag
119108
}
120-
getStructFields := func(typ reflect2.StructType) map[string]structField {
109+
getStructFields := func(typ reflect.Type) map[string]structField {
121110
out := make(map[string]structField)
122111
for i := typ.NumField() - 1; i >= 0; i-- {
123112
field := structField{StructField: typ.Field(i)}
124-
field.structTag = field.Tag()
113+
field.structTag = field.Tag
125114
configTag := strings.Split(field.structTag.Get("config"), ",")
126115
configName := configTag[0]
127116
if configName == "" {
128-
configName = strings.ToLower(field.Name())
117+
configName = strings.ToLower(field.Name)
129118
}
130119
out[configName] = field
131120
}
@@ -160,10 +149,10 @@ func TestBeatsConfigSynced(t *testing.T) {
160149
libbeatStructField := libbeatStructFields[name]
161150
assert.Equal(t, localStructField.structTag, libbeatStructField.structTag)
162151
assert.Equal(t,
163-
localStructField.Type(),
164-
libbeatStructField.Type(),
152+
localStructField.Type,
153+
libbeatStructField.Type,
165154
fmt.Sprintf("expected type %s for config field %q, got %s",
166-
libbeatStructField.Type(), name, localStructField.Type(),
155+
libbeatStructField.Type, name, localStructField.Type,
167156
),
168157
)
169158
delete(libbeatStructFields, name)

0 commit comments

Comments
 (0)