From fd6d31280bf87b94d68117d847c5781c266463a8 Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Tue, 23 Jul 2024 14:57:13 +0530 Subject: [PATCH] fix: update go.mod, update uuid and metrics version --- go.mod | 3 ++- go.sum | 6 ++++-- heartbeat/monitors/mocks.go | 2 +- libbeat/beat/info.go | 2 +- libbeat/cmd/instance/beat.go | 2 +- metricbeat/module/system/process/process.go | 3 ++- metricbeat/module/system/process_summary/process_summary.go | 3 ++- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index f03f5dfad81..598a1f88037 100644 --- a/go.mod +++ b/go.mod @@ -199,7 +199,7 @@ require ( github.com/elastic/ebpfevents v0.6.0 github.com/elastic/elastic-agent-autodiscover v0.7.0 github.com/elastic/elastic-agent-libs v0.9.13 - github.com/elastic/elastic-agent-system-metrics v0.10.3 + github.com/elastic/elastic-agent-system-metrics v0.10.5 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.0 @@ -294,6 +294,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 diff --git a/go.sum b/go.sum index c11afd8afdc..312308fbae5 100644 --- a/go.sum +++ b/go.sum @@ -551,8 +551,8 @@ github.com/elastic/elastic-agent-client/v7 v7.13.0 h1:ENCfV5XIMmjWo9/0J7t//5N7xg 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-system-metrics v0.10.5 h1:a0bDdSOE6jfBIFqTuHJ8uOPXKcWOZJ5GJRkCUZbn0JA= +github.com/elastic/elastic-agent-system-metrics v0.10.5/go.mod h1:cd7YgcTEjBNeLGnH/C9cEvP/YexohwS6CpmN9Ju58Mw= 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= @@ -852,6 +852,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= diff --git a/heartbeat/monitors/mocks.go b/heartbeat/monitors/mocks.go index f8747a80400..c172d24464c 100644 --- a/heartbeat/monitors/mocks.go +++ b/heartbeat/monitors/mocks.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/gofrs/uuid" + "github.com/gofrs/uuid/v5" "github.com/stretchr/testify/require" "github.com/elastic/elastic-agent-libs/config" diff --git a/libbeat/beat/info.go b/libbeat/beat/info.go index 23dfe9be0be..57f9a570fbc 100644 --- a/libbeat/beat/info.go +++ b/libbeat/beat/info.go @@ -20,7 +20,7 @@ package beat import ( "time" - "github.com/gofrs/uuid" + "github.com/gofrs/uuid/v5" ) // Info stores a beats instance meta data. diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index c15d9b8c200..b38405a94fd 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -37,7 +37,7 @@ import ( "strings" "time" - "github.com/gofrs/uuid" + "github.com/gofrs/uuid/v5" "go.uber.org/zap" "github.com/elastic/beats/v7/libbeat/api" diff --git a/metricbeat/module/system/process/process.go b/metricbeat/module/system/process/process.go index 774745b2b34..cebe224916e 100644 --- a/metricbeat/module/system/process/process.go +++ b/metricbeat/module/system/process/process.go @@ -20,6 +20,7 @@ package process import ( + "errors" "fmt" "os" "runtime" @@ -111,7 +112,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { // monitor either a single PID, or the configured set of processes. if m.setpid == 0 { procs, roots, err := m.stats.Get() - if err != nil && !process.CanDegrade(err) { + if err != nil && !errors.Is(err, process.NonFatalErr{}) { return fmt.Errorf("process stats: %w", err) } diff --git a/metricbeat/module/system/process_summary/process_summary.go b/metricbeat/module/system/process_summary/process_summary.go index 7fde92e8a9c..a7b0681ef5e 100644 --- a/metricbeat/module/system/process_summary/process_summary.go +++ b/metricbeat/module/system/process_summary/process_summary.go @@ -20,6 +20,7 @@ package process_summary import ( + "errors" "fmt" "io/ioutil" "runtime" @@ -69,7 +70,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { func (m *MetricSet) Fetch(r mb.ReporterV2) error { procList, degradeErr := process.ListStates(m.sys) - if degradeErr != nil && !process.CanDegrade(degradeErr) { + if degradeErr != nil && !errors.Is(degradeErr, process.NonFatalErr{}) { return fmt.Errorf("error fetching process list: %w", degradeErr) }