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

[8.15](backport #40324) use go-sysinfo v1.14.1 and elastic-agent-system-metrics v0.10.6 #40523

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
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: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]

*Affecting all Beats*

- Update Go version to 1.22.5. {pull}40082[40082]
- Fix FQDN being lowercased when used as `host.hostname` {issue}39993[39993]

*Auditbeat*

Expand Down
46 changes: 38 additions & 8 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13031,11 +13031,11 @@ SOFTWARE

--------------------------------------------------------------------------------
Dependency : github.com/elastic/elastic-agent-libs
Version: v0.9.13
Version: v0.9.15
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].13/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected].15/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -13241,12 +13241,12 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-l


--------------------------------------------------------------------------------
Dependency : github.com/elastic/elastic-agent-system-metrics
Version: v0.10.3
Dependency : github.com/AndersonQ/elastic-agent-system-metrics
Version: v0.0.0-20240823144436-2bb48489e782
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/elastic-agent-system-metrics@v0.10.3/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/!anderson!q/elastic-agent-system-metrics@v0.0.0-20240823144436-2bb48489e782/LICENSE.txt:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -15212,12 +15212,12 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-structform@v


--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-sysinfo
Version: v1.14.0
Dependency : github.com/AndersonQ/go-sysinfo
Version: v0.0.0-20240823130150-199943165104
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.14.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/!anderson!q/go-sysinfo@v0.0.0-20240823130150-199943165104/LICENSE.txt:


Apache License
Expand Down Expand Up @@ -38683,6 +38683,36 @@ Contents of probable licence file $GOMODCACHE/github.com/godror/[email protected]/L
limitations under the License.


--------------------------------------------------------------------------------
Dependency : github.com/gofrs/uuid/v5
Version: v5.2.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/gofrs/uuid/[email protected]/LICENSE:

Copyright (C) 2013-2018 by Maxim Bublis <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/golang-jwt/jwt/v4
Version: v4.5.0
Expand Down
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ require (
github.com/elastic/go-perf v0.0.0-20191212140718-9c656876f595
github.com/elastic/go-seccomp-bpf v1.4.0
github.com/elastic/go-structform v0.0.10
github.com/elastic/go-sysinfo v1.14.0
github.com/elastic/go-sysinfo v1.14.1
github.com/elastic/go-ucfg v0.8.8
github.com/elastic/gosigar v0.14.3
github.com/fatih/color v1.16.0
Expand Down Expand Up @@ -198,8 +198,8 @@ require (
github.com/elastic/bayeux v1.0.5
github.com/elastic/ebpfevents v0.6.0
github.com/elastic/elastic-agent-autodiscover v0.8.1
github.com/elastic/elastic-agent-libs v0.9.13
github.com/elastic/elastic-agent-system-metrics v0.10.3
github.com/elastic/elastic-agent-libs v0.9.15
github.com/elastic/elastic-agent-system-metrics v0.10.6
github.com/elastic/go-elasticsearch/v8 v8.14.0
github.com/elastic/go-sfdc v0.0.0-20240621062639-bcc8456508ff
github.com/elastic/mito v1.13.1
Expand Down Expand Up @@ -296,6 +296,7 @@ require (
github.com/gobuffalo/here v0.6.7 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/godror/knownpb v0.1.0 // indirect
github.com/gofrs/uuid/v5 v5.2.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
Expand Down Expand Up @@ -421,3 +422,7 @@ replace (

// Exclude this version because the version has an invalid checksum.
exclude github.com/docker/distribution v2.8.0+incompatible

replace github.com/elastic/go-sysinfo => github.com/AndersonQ/go-sysinfo v0.0.0-20240823130150-199943165104

replace github.com/elastic/elastic-agent-system-metrics => github.com/AndersonQ/elastic-agent-system-metrics v0.0.0-20240823144436-2bb48489e782
14 changes: 8 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN
github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
github.com/AndersonQ/elastic-agent-system-metrics v0.0.0-20240823144436-2bb48489e782 h1:TT9rIGqENdLaoKsEh0UribzH7gKGcVwbkr7UstxBWE0=
github.com/AndersonQ/elastic-agent-system-metrics v0.0.0-20240823144436-2bb48489e782/go.mod h1:vxvlAbRiY32+PrVfbznbHFoSyFfr00DTc3KV3Vblq04=
github.com/AndersonQ/go-sysinfo v0.0.0-20240823130150-199943165104 h1:YyZnzVnjriHj+uQzvd3i1yR3m/fnyLwEokL3dgSNGZY=
github.com/AndersonQ/go-sysinfo v0.0.0-20240823130150-199943165104/go.mod h1:FKUXnZWhnYI0ueO7jhsGV3uQJ5hiz8OqM5b3oGyaRr8=
github.com/Azure/azure-amqp-common-go/v4 v4.2.0 h1:q/jLx1KJ8xeI8XGfkOWMN9XrXzAfVTkyvCxPvHCjd2I=
github.com/Azure/azure-amqp-common-go/v4 v4.2.0/go.mod h1:GD3m/WPPma+621UaU6KNjKEo5Hl09z86viKwQjTpV0Q=
github.com/Azure/azure-event-hubs-go/v3 v3.6.1 h1:vSiMmn3tOwgiLyfnmhT5K6Of/3QWRLaaNZPI0hFvZyU=
Expand Down Expand Up @@ -558,10 +562,8 @@ github.com/elastic/elastic-agent-autodiscover v0.8.1 h1:u6TWqh7wfevu6S4GUq4SIxYB
github.com/elastic/elastic-agent-autodiscover v0.8.1/go.mod h1:0gzGsaDCAqBfUZjuCqqWsSI60eaZ778A5tQZV72rPV0=
github.com/elastic/elastic-agent-client/v7 v7.13.0 h1:ENCfV5XIMmjWo9/0J7t//5N7xgm43Ktg0SyIomupRcA=
github.com/elastic/elastic-agent-client/v7 v7.13.0/go.mod h1:h2yJHN8Q5rhfi9i6FfyPufh+StFN+UD9PYGv8blXKbE=
github.com/elastic/elastic-agent-libs v0.9.13 h1:D1rh1s67zlkDWmixWQaNWzn+qy6DafIDPTQnLpBNBUA=
github.com/elastic/elastic-agent-libs v0.9.13/go.mod h1:G9ljFvDE+muOOOQBf2eRituF0fE4suGkv25rfjTwY+c=
github.com/elastic/elastic-agent-system-metrics v0.10.3 h1:8pWdj8DeY8PBG/BA0DJalRpJWruDoP5QrIP/YKug5dE=
github.com/elastic/elastic-agent-system-metrics v0.10.3/go.mod h1:3JwPa3zZJjmBYN87xwdLcFpHrUkWpR863jiYdg39sSc=
github.com/elastic/elastic-agent-libs v0.9.15 h1:WCLtuErafUxczT/rXJa4Vr6mxwC8dgtqMbEq+qWGD4M=
github.com/elastic/elastic-agent-libs v0.9.15/go.mod h1:2VgYxHaeM+cCDBjiS2wbmTvzPGbnlXAtYrlcLefheS8=
github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA=
github.com/elastic/elastic-transport-go/v8 v8.6.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270 h1:cWPqxlPtir4RoQVCpGSRXmLqjEHpJKbR60rxh1nQZY4=
Expand All @@ -588,8 +590,6 @@ github.com/elastic/go-sfdc v0.0.0-20240621062639-bcc8456508ff h1:VjmGr45YsntTPgT
github.com/elastic/go-sfdc v0.0.0-20240621062639-bcc8456508ff/go.mod h1:sw1pzz4pIqzDQxFWt3dFoG2uIUFAfThxlMfWpjH590E=
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-sysinfo v1.14.0 h1:dQRtiqLycoOOla7IflZg3aN213vqJmP0lpVpKQ9lUEY=
github.com/elastic/go-sysinfo v1.14.0/go.mod h1:FKUXnZWhnYI0ueO7jhsGV3uQJ5hiz8OqM5b3oGyaRr8=
github.com/elastic/go-ucfg v0.8.8 h1:54KIF/2zFKfl0MzsSOCGOsZ3O2bnjFQJ0nDJcLhviyk=
github.com/elastic/go-ucfg v0.8.8/go.mod h1:4E8mPOLSUV9hQ7sgLEJ4bvt0KhMuDJa8joDT2QGAEKA=
github.com/elastic/go-windows v1.0.1 h1:AlYZOldA+UJ0/2nBuqWdo90GFCgG9xuyw9SYzGUtJm0=
Expand Down Expand Up @@ -862,6 +862,8 @@ github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
Expand Down
7 changes: 6 additions & 1 deletion libbeat/cmd/instance/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ func NewBeat(name, indexPrefix, v string, elasticLicensed bool, initFuncs []func
return nil, err
}

eid, err := uuid.FromString(metricreport.EphemeralID().String())
if err != nil {
return nil, fmt.Errorf("failed to generate EphemeralID from UUID string: %w", err)
}

b := beat.Beat{
Info: beat.Info{
Beat: name,
Expand All @@ -275,7 +280,7 @@ func NewBeat(name, indexPrefix, v string, elasticLicensed bool, initFuncs []func
ID: id,
FirstStart: time.Now(),
StartTime: time.Now(),
EphemeralID: metricreport.EphemeralID(),
EphemeralID: eid,
},
Fields: fields,
}
Expand Down
6 changes: 3 additions & 3 deletions libbeat/processors/add_host_metadata/add_host_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ func (p *addHostMetadata) Run(event *beat.Event) (*beat.Event, error) {
// deregister the callback. But processors that can be used with the
// `script` processor are not allowed to implement the Closer
// interface (@see https://github.com/elastic/beats/pull/16349).
//func (p *addHostMetadata) Close() error {
// func (p *addHostMetadata) Close() error {
// features.RemoveFQDNOnChangeCallback(processorName)
// return nil
//}
// }

func (p *addHostMetadata) expired() bool {

Expand All @@ -172,7 +172,7 @@ func (p *addHostMetadata) loadData(checkCache bool, useFQDN bool) error {
return nil
}

h, err := sysinfo.Host()
h, err := sysinfo.Host(sysinfo.WithLowerHostname())
if err != nil {
return fmt.Errorf("error collecting host info: %w", err)
}
Expand Down
Loading