Skip to content

Commit

Permalink
[updatecli] Update to elastic/beats@9b71f4382c03 (#15507)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
1 parent a3e7297 commit 7bd645b
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 252 deletions.
434 changes: 217 additions & 217 deletions NOTICE.txt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/elastic/apm-aggregation v1.2.0
github.com/elastic/apm-data v1.16.0
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03
github.com/elastic/elastic-agent-client/v7 v7.17.0
github.com/elastic/elastic-agent-libs v0.18.2
github.com/elastic/elastic-agent-system-metrics v0.11.7
Expand All @@ -28,7 +28,6 @@ require (
github.com/jaegertracing/jaeger v1.64.0
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
github.com/libp2p/go-reuseport v0.4.0
github.com/modern-go/reflect2 v1.0.2
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.116.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -89,7 +88,7 @@ require (
github.com/ebitengine/purego v0.8.1 // indirect
github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f // indirect
github.com/elastic/go-structform v0.0.10 // indirect
github.com/elastic/go-structform v0.0.12 // indirect
github.com/elastic/go-windows v1.0.2 // indirect
github.com/elastic/gosigar v0.14.3 // indirect
github.com/elastic/opentelemetry-lib v0.14.0 // indirect
Expand Down Expand Up @@ -124,6 +123,7 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
Expand Down Expand Up @@ -157,7 +157,7 @@ require (
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
howett.net/plist v1.0.1 // indirect
)
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.6.0 h1:AAIdAyPkFff6XTct2lQCxOWN/+LnA41S7kIkzKaMbyE=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.6.0/go.mod h1:noQIdW75SiQFB3mSFJBr4iRRH83S9skaFiBv4C0uEs0=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0 h1:0nGmzwBv5ougvzfGPCO2ljFRHvun57KpNrVCMrlk0ns=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0/go.mod h1:gYq8wyDgv6JLhGbAU6gg8amCPgQWRE+aCvrV2gyzdfs=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down Expand Up @@ -132,8 +132,8 @@ github.com/elastic/apm-aggregation v1.2.0 h1:UndqG3ccBTjyxTqHujBVjcbVLb9qG1clxRc
github.com/elastic/apm-aggregation v1.2.0/go.mod h1:YllYwPYVV27pbuPfjRtQAKo6eSSrh13PZr38RKYd810=
github.com/elastic/apm-data v1.16.0 h1:LkJFoNkadIyqXNo3EMm98J38j9HWDMWUe6F74GaXtJ4=
github.com/elastic/apm-data v1.16.0/go.mod h1:ST2P1yshhN2U3IbBYyn+Ni3VOFTifavNzMfh7E9zLHY=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d h1:f7HWnj35BO90r0gWRz3DFhLL/y8bTQhHASDgY+AAd+4=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250102181502-1f91ed31767d/go.mod h1:KCqU8Vg/PRlBpjFS0vT6EMLzI16+85md82k/glDEVQ8=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03 h1:z6A5ysZE+JcT8d9JksKTQbUJrLbzA8CMYnYmOc0sGys=
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250131074959-9b71f4382c03/go.mod h1:CFo2FS1mW8elnNyw3Klq61X0QqRVrkAM7s17+bt+4Fo=
github.com/elastic/elastic-agent-autodiscover v0.9.0 h1:+iWIKh0u3e8I+CJa3FfWe9h0JojNasPgYIA47gpuuns=
github.com/elastic/elastic-agent-autodiscover v0.9.0/go.mod h1:5iUxLHhVdaGSWYTveSwfJEY4RqPXTG13LPiFoxcpFd4=
github.com/elastic/elastic-agent-client/v7 v7.17.0 h1:TPLrEHF4kJ3RkmQzZPffrniY4WeW4vriHZbOAzM1hFo=
Expand All @@ -152,8 +152,8 @@ github.com/elastic/go-elasticsearch/v8 v8.17.0 h1:e9cWksE/Fr7urDRmGPGp47Nsp4/mvN
github.com/elastic/go-elasticsearch/v8 v8.17.0/go.mod h1:lGMlgKIbYoRvay3xWBeKahAiJOgmFDsjZC39nmO3H64=
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f h1:TsPpU5EAwlt7YZoupKlxZ093qTZYdGou3EhfTF1U0B4=
github.com/elastic/go-lumber v0.1.2-0.20220819171948-335fde24ea0f/go.mod h1:HHaWnZamYKWsR9/eZNHqRHob8iQDKnchHmmskT/SKko=
github.com/elastic/go-structform v0.0.10 h1:oy08o/Ih2hHTkNcRY/1HhaYvIp5z6t8si8gnCJPDo1w=
github.com/elastic/go-structform v0.0.10/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
github.com/elastic/go-structform v0.0.12 h1:HXpzlAKyej8T7LobqKDThUw7BMhwV6Db24VwxNtgxCs=
github.com/elastic/go-structform v0.0.12/go.mod h1:CZWf9aIRYY5SuKSmOhtXScE5uQiLZNqAFnwKR4OrIM4=
github.com/elastic/go-sysinfo v1.15.0 h1:54pRFlAYUlVNQ2HbXzLVZlV+fxS7Eax49stzg95M4Xw=
github.com/elastic/go-sysinfo v1.15.0/go.mod h1:jPSuTgXG+dhhh0GKIyI2Cso+w5lPJ5PvVqKlL8LV/Hk=
github.com/elastic/go-ucfg v0.8.8 h1:54KIF/2zFKfl0MzsSOCGOsZ3O2bnjFQJ0nDJcLhviyk=
Expand Down Expand Up @@ -632,8 +632,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand Down
7 changes: 6 additions & 1 deletion internal/beatcmd/beat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ func TestRunManager_Reloader_newRunnerError(t *testing.T) {
require.NoError(t, err)
defer manager.Stop()

assert.Equal(t, "failed to load input config: newRunner error", <-inputFailedMsg)
select {
case msg := <-inputFailedMsg:
assert.Equal(t, "failed to load input config: newRunner error", msg)
case <-time.After(10 * time.Second):
t.Fatal("timed out waiting for input failed msg")
}
}

func runBeat(t testing.TB, beat *Beat) (stop func() error) {
Expand Down
3 changes: 2 additions & 1 deletion internal/beatcmd/reloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"fmt"
"sync"

"github.com/joeshaw/multierror"
"golang.org/x/sync/errgroup"

"github.com/joeshaw/multierror"

"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/cfgfile"
"github.com/elastic/beats/v7/libbeat/common/reload"
Expand Down
31 changes: 10 additions & 21 deletions internal/elasticsearch/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ import (
"strings"
"testing"

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

"github.com/modern-go/reflect2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -101,31 +99,22 @@ func TestAddresses(t *testing.T) {
// TestBeatsConfigSynced helps ensure that our elasticsearch.Config struct is
// kept in sync with the config defined in libbeat/outputs/elasticsearch.
func TestBeatsConfigSynced(t *testing.T) {
libbeatType, _ := reflect2.TypeByPackageName(
"github.com/elastic/beats/v7/libbeat/outputs/elasticsearch",
"elasticsearchConfig",
).(reflect2.StructType)
require.NotNil(t, libbeatType)

localType, _ := reflect2.TypeByPackageName(
"github.com/elastic/apm-server/internal/elasticsearch",
"Config",
).(reflect2.StructType)
require.NotNil(t, localType)
libbeatType := reflect.TypeOf(libbeates.ElasticsearchConfig{})
localType := reflect.TypeOf(Config{})

type structField struct {
reflect2.StructField
reflect.StructField
structTag reflect.StructTag
}
getStructFields := func(typ reflect2.StructType) map[string]structField {
getStructFields := func(typ reflect.Type) map[string]structField {
out := make(map[string]structField)
for i := typ.NumField() - 1; i >= 0; i-- {
field := structField{StructField: typ.Field(i)}
field.structTag = field.Tag()
field.structTag = field.Tag
configTag := strings.Split(field.structTag.Get("config"), ",")
configName := configTag[0]
if configName == "" {
configName = strings.ToLower(field.Name())
configName = strings.ToLower(field.Name)
}
out[configName] = field
}
Expand Down Expand Up @@ -160,10 +149,10 @@ func TestBeatsConfigSynced(t *testing.T) {
libbeatStructField := libbeatStructFields[name]
assert.Equal(t, localStructField.structTag, libbeatStructField.structTag)
assert.Equal(t,
localStructField.Type(),
libbeatStructField.Type(),
localStructField.Type,
libbeatStructField.Type,
fmt.Sprintf("expected type %s for config field %q, got %s",
libbeatStructField.Type(), name, localStructField.Type(),
libbeatStructField.Type, name, localStructField.Type,
),
)
delete(libbeatStructFields, name)
Expand Down

0 comments on commit 7bd645b

Please sign in to comment.