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

[7.17](backport #37212) Replace EOL modules: github.com/golang/protobuf by google.golang.org/protobuf #37469

Merged
merged 21 commits into from
Jan 5, 2024
Merged
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
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29306,11 +29306,11 @@ Contents of probable licence file $GOMODCACHE/github.com/google/[email protected]/LI

--------------------------------------------------------------------------------
Dependency : github.com/google/licenseclassifier
Version: v0.0.0-20200402202327-879cb1424de0
Version: v0.0.0-20221004142553-c1ed8fcf4bab
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/google/[email protected]20200402202327-879cb1424de0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/google/[email protected]20221004142553-c1ed8fcf4bab/LICENSE:


Apache License
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ require (
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/golang/snappy v0.0.4
github.com/gomodule/redigo v1.8.3
github.com/google/flatbuffers v23.3.3+incompatible
Expand Down Expand Up @@ -199,6 +198,7 @@ require (
require (
github.com/elastic/elastic-agent-libs v0.6.2
github.com/elastic/elastic-agent-system-metrics v0.4.4
github.com/golang/protobuf v1.5.3
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98
)

Expand Down Expand Up @@ -242,7 +242,7 @@ require (
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/licenseclassifier v0.0.0-20200402202327-879cb1424de0 // indirect
github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
Expand Down
4 changes: 3 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,10 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/licenseclassifier v0.0.0-20200402202327-879cb1424de0 h1:OggOMmdI0JLwg1FkOKH9S7fVHF0oEm8PX6S8kAdpOps=
github.com/google/licenseclassifier v0.0.0-20200402202327-879cb1424de0/go.mod h1:qsqn2hxC+vURpyBRygGUuinTO42MFRLcsmQ/P8v94+M=
github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab h1:okY7fFoWybMbxiHkaqStN4mxSrPfYmTZl5Zh32Z5FjY=
github.com/google/licenseclassifier v0.0.0-20221004142553-c1ed8fcf4bab/go.mod h1:jkYIPv59uiw+1MxTWlqQEKebsUDV1DCXQtBBn5lVzf4=
github.com/google/licenseclassifier/v2 v2.0.0-alpha.1/go.mod h1:YAgBGGTeNDMU+WfIgaFvjZe4rudym4f6nIn8ZH5X+VM=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/httpjson/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func TestStatelessHTTPJSONInput(t *testing.T) {
var g errgroup.Group
g.Go(func() error { return input.Run(ctx, chanClient) })

timeout := time.NewTimer(5 * time.Second)
timeout := time.NewTimer(10 * time.Second)
t.Cleanup(func() { _ = timeout.Stop() })

var receivedCount int
Expand Down
7 changes: 4 additions & 3 deletions x-pack/functionbeat/provider/aws/aws/kinesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
"github.com/aws/aws-lambda-go/events"
"github.com/awslabs/kinesis-aggregation/go/deaggregator"
aggRecProto "github.com/awslabs/kinesis-aggregation/go/records"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/runtime/protoimpl"

"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/x-pack/functionbeat/function/provider"
Expand Down Expand Up @@ -133,14 +134,14 @@ func generateAggregatedKinesisEvent(validRec bool) events.KinesisEvent {
partKeyTable = append(partKeyTable, "0")

aggRec.PartitionKeyTable = partKeyTable
data, _ := proto.Marshal(aggRec)
data, _ := proto.Marshal(protoimpl.X.ProtoMessageV2Of(aggRec))
md5Hash := md5.Sum(data)
aggRecBytes = append(aggRecBytes, data...)
aggRecBytes = append(aggRecBytes, md5Hash[:]...)

return events.KinesisEvent{
Records: []events.KinesisEventRecord{
events.KinesisEventRecord{
{
AwsRegion: "east-1",
EventID: "1234",
EventName: "connect",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import (
"testing"
"time"

"google.golang.org/protobuf/runtime/protoimpl"

"github.com/aws/aws-lambda-go/events"
"github.com/awslabs/kinesis-aggregation/go/deaggregator"
aggRecProto "github.com/awslabs/kinesis-aggregation/go/records"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"

"github.com/elastic/beats/v7/libbeat/beat"
"github.com/elastic/beats/v7/libbeat/common"
Expand All @@ -31,7 +33,7 @@ func TestCloudwatch(t *testing.T) {
SubscriptionFilters: []string{"MyFilter"},
MessageType: "DATA_MESSAGE",
LogEvents: []events.CloudwatchLogsLogEvent{
events.CloudwatchLogsLogEvent{
{
ID: "1234567890123456789",
Timestamp: 1566908691193,
Message: "my interesting message",
Expand Down Expand Up @@ -391,7 +393,7 @@ func generateKinesisAggregateRecord(numRecords int, valid bool) []byte {
}

aggRec.PartitionKeyTable = partKeyTable
data, _ := proto.Marshal(aggRec)
data, _ := proto.Marshal(protoimpl.X.ProtoMessageV2Of(aggRec))
md5Hash := md5.Sum(data)
aggRecBytes = append(aggRecBytes, data...)
aggRecBytes = append(aggRecBytes, md5Hash[:]...)
Expand Down
12 changes: 6 additions & 6 deletions x-pack/metricbeat/module/gcp/metrics/compute/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ package compute
import (
"testing"

"github.com/golang/protobuf/ptypes/timestamp"
monitoring "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
"github.com/stretchr/testify/assert"
"google.golang.org/genproto/googleapis/api/metric"
"google.golang.org/genproto/googleapis/api/monitoredres"
monitoring "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/protobuf/types/known/timestamppb"
)

var fake = &monitoring.TimeSeries{
Expand Down Expand Up @@ -41,10 +41,10 @@ var fake = &monitoring.TimeSeries{
Value: &monitoring.TypedValue_DoubleValue{DoubleValue: 0.0041224284852319215},
},
Interval: &monitoring.TimeInterval{
StartTime: &timestamp.Timestamp{
StartTime: &timestamppb.Timestamp{
Seconds: 1569932700,
},
EndTime: &timestamp.Timestamp{
EndTime: &timestamppb.Timestamp{
Seconds: 1569932700,
},
},
Expand All @@ -53,10 +53,10 @@ var fake = &monitoring.TimeSeries{
Value: &monitoring.TypedValue_DoubleValue{DoubleValue: 0.004205757571772513},
},
Interval: &monitoring.TimeInterval{
StartTime: &timestamp.Timestamp{
StartTime: &timestamppb.Timestamp{
Seconds: 1569932640,
},
EndTime: &timestamp.Timestamp{
EndTime: &timestamppb.Timestamp{
Seconds: 1569932640,
},
},
Expand Down
15 changes: 7 additions & 8 deletions x-pack/metricbeat/module/gcp/metrics/metrics_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
"sync"
"time"

"github.com/golang/protobuf/ptypes/duration"

monitoring "cloud.google.com/go/monitoring/apiv3"
"github.com/golang/protobuf/ptypes/timestamp"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
"google.golang.org/api/iterator"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/x-pack/metricbeat/module/gcp"
Expand Down Expand Up @@ -52,7 +51,7 @@
it := r.client.ListTimeSeries(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {

Check failure on line 54 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (windows)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 54 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (linux)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 54 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
break
}

Expand All @@ -66,7 +65,7 @@

out.aligner = aligner
out.timeSeries = timeSeries
return

Check failure on line 68 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (windows)

naked return in func `Metric` with 32 lines of code (nakedret)

Check failure on line 68 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (linux)

naked return in func `Metric` with 32 lines of code (nakedret)

Check failure on line 68 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

naked return in func `Metric` with 32 lines of code (nakedret)
}

func (r *metricsRequester) Metrics(ctx context.Context, serviceName string, aligner string, metricsToCollect map[string]metricMeta) ([]timeSeriesWithAligner, error) {
Expand Down Expand Up @@ -111,7 +110,7 @@

region := r.config.Region
if region != "" {
if strings.HasSuffix(region, "*") {

Check failure on line 113 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (windows)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)

Check failure on line 113 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (linux)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)

Check failure on line 113 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)
region = strings.TrimSuffix(region, "*")
}
f = fmt.Sprintf("%s AND resource.label.location=starts_with(\"%s\")", f, region)
Expand All @@ -119,7 +118,7 @@
}
zone := r.config.Zone
if zone != "" {
if strings.HasSuffix(zone, "*") {

Check failure on line 121 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (windows)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)

Check failure on line 121 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (linux)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)

Check failure on line 121 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

S1017: should replace this if statement with an unconditional strings.TrimSuffix (gosimple)
zone = strings.TrimSuffix(zone, "*")
}
f = fmt.Sprintf("%s AND resource.label.location=starts_with(\"%s\")", f, zone)
Expand Down Expand Up @@ -152,11 +151,11 @@
}
}
r.logger.Debugf("ListTimeSeries API filter = %s", f)
return

Check failure on line 154 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (windows)

naked return in func `getFilterForMetric` with 57 lines of code (nakedret)

Check failure on line 154 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (linux)

naked return in func `getFilterForMetric` with 57 lines of code (nakedret)

Check failure on line 154 in x-pack/metricbeat/module/gcp/metrics/metrics_requester.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

naked return in func `getFilterForMetric` with 57 lines of code (nakedret)
}

// Returns a GCP TimeInterval based on the ingestDelay and samplePeriod from ListMetricDescriptor
func getTimeIntervalAligner(ingestDelay time.Duration, samplePeriod time.Duration, collectionPeriod *duration.Duration, inputAligner string) (*monitoringpb.TimeInterval, string) {
func getTimeIntervalAligner(ingestDelay time.Duration, samplePeriod time.Duration, collectionPeriod *durationpb.Duration, inputAligner string) (*monitoringpb.TimeInterval, string) {
var startTime, endTime, currentTime time.Time
var needsAggregation bool
currentTime = time.Now().UTC()
Expand All @@ -180,10 +179,10 @@
}

interval := &monitoringpb.TimeInterval{
StartTime: &timestamp.Timestamp{
StartTime: &timestamppb.Timestamp{
Seconds: startTime.Unix(),
},
EndTime: &timestamp.Timestamp{
EndTime: &timestamppb.Timestamp{
Seconds: endTime.Unix(),
},
}
Expand Down
12 changes: 6 additions & 6 deletions x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

"github.com/golang/protobuf/ptypes/duration"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/types/known/durationpb"

"github.com/elastic/beats/v7/libbeat/logp"
)
Expand Down Expand Up @@ -122,15 +122,15 @@ func TestGetTimeIntervalAligner(t *testing.T) {
title string
ingestDelay time.Duration
samplePeriod time.Duration
collectionPeriod *duration.Duration
collectionPeriod *durationpb.Duration
inputAligner string
expectedAligner string
}{
{
"test collectionPeriod equals to samplePeriod",
time.Duration(240) * time.Second,
time.Duration(60) * time.Second,
&duration.Duration{
&durationpb.Duration{
Seconds: int64(60),
},
"",
Expand All @@ -140,7 +140,7 @@ func TestGetTimeIntervalAligner(t *testing.T) {
"test collectionPeriod larger than samplePeriod",
time.Duration(240) * time.Second,
time.Duration(60) * time.Second,
&duration.Duration{
&durationpb.Duration{
Seconds: int64(300),
},
"ALIGN_MEAN",
Expand All @@ -150,7 +150,7 @@ func TestGetTimeIntervalAligner(t *testing.T) {
"test collectionPeriod smaller than samplePeriod",
time.Duration(240) * time.Second,
time.Duration(60) * time.Second,
&duration.Duration{
&durationpb.Duration{
Seconds: int64(30),
},
"ALIGN_MAX",
Expand All @@ -160,7 +160,7 @@ func TestGetTimeIntervalAligner(t *testing.T) {
"test collectionPeriod equals to samplePeriod with given aligner",
time.Duration(240) * time.Second,
time.Duration(60) * time.Second,
&duration.Duration{
&durationpb.Duration{
Seconds: int64(60),
},
"ALIGN_MEAN",
Expand Down
12 changes: 6 additions & 6 deletions x-pack/metricbeat/module/gcp/metrics/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"strings"
"time"

monitoring "cloud.google.com/go/monitoring/apiv3"
"github.com/golang/protobuf/ptypes/duration"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
"github.com/pkg/errors"

Check failure on line 15 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (windows)

import of package `github.com/pkg/errors` is blocked because the module is in the blocked modules list. `errors` and `fmt` are recommended modules. This package is deprecated, use `fmt.Errorf` with `%!w(MISSING)` instead. (gomodguard)

Check failure on line 15 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (linux)

import of package `github.com/pkg/errors` is blocked because the module is in the blocked modules list. `errors` and `fmt` are recommended modules. This package is deprecated, use `fmt.Errorf` with `%!w(MISSING)` instead. (gomodguard)

Check failure on line 15 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

import of package `github.com/pkg/errors` is blocked because the module is in the blocked modules list. `errors` and `fmt` are recommended modules. This package is deprecated, use `fmt.Errorf` with `%!w(MISSING)` instead. (gomodguard)
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/genproto/googleapis/api/metric"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/protobuf/types/known/durationpb"

"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
Expand Down Expand Up @@ -106,7 +106,7 @@
CredentialsFilePath string `config:"credentials_file_path"`

opt []option.ClientOption
period *duration.Duration
period *durationpb.Duration
}

// New creates a new instance of the MetricSet. New is responsible for unpacking
Expand All @@ -130,7 +130,7 @@

m.MetricsConfig = metricsConfigs.Metrics
m.config.opt = []option.ClientOption{option.WithCredentialsFile(m.config.CredentialsFilePath)}
m.config.period = &duration.Duration{
m.config.period = &durationpb.Duration{
Seconds: int64(m.Module().Config().Period.Seconds()),
}

Expand Down Expand Up @@ -212,7 +212,7 @@
return nil, errors.Wrap(err, "error trying to group time series data")
}

//Create single events for each group of data that matches some common patterns like labels and timestamp
// Create single events for each group of data that matches some common patterns like labels and timestamp
events := make([]mb.Event, 0)
for _, groupedEvents := range tsGrouped {
event := mb.Event{
Expand All @@ -224,7 +224,7 @@
}

for _, singleEvent := range groupedEvents {
event.MetricSetFields.Put(singleEvent.Key, singleEvent.Value)

Check failure on line 227 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `event.MetricSetFields.Put` is not checked (errcheck)

Check failure on line 227 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `event.MetricSetFields.Put` is not checked (errcheck)

Check failure on line 227 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

Error return value of `event.MetricSetFields.Put` is not checked (errcheck)
}

if sdc.ServiceName == "compute" {
Expand Down Expand Up @@ -279,7 +279,7 @@

for {
out, err := it.Next()
if err != nil && err != iterator.Done {

Check failure on line 282 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (windows)

comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 282 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (linux)

comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 282 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
err = errors.Errorf("Could not make ListMetricDescriptors request for metric type %s: %v", mt, err)
m.Logger().Error(err)
return metricsWithMeta, err
Expand All @@ -289,7 +289,7 @@
metricsWithMeta = m.getMetadata(out, metricsWithMeta)
}

if err == iterator.Done {

Check failure on line 292 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (windows)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 292 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (linux)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)

Check failure on line 292 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
break
}

Expand Down Expand Up @@ -334,7 +334,7 @@
hostRootFields := groupedEvents[0].ECS
// add host.id and host.name
if hostID, err := groupedEvents[0].ECS.GetValue("cloud.instance.id"); err == nil {
hostRootFields.Put("host.id", hostID)

Check failure on line 337 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Error return value of `hostRootFields.Put` is not checked (errcheck)

Check failure on line 337 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `hostRootFields.Put` is not checked (errcheck)

Check failure on line 337 in x-pack/metricbeat/module/gcp/metrics/metricset.go

View workflow job for this annotation

GitHub Actions / lint (darwin)

Error return value of `hostRootFields.Put` is not checked (errcheck)
}

if hostName, err := groupedEvents[0].ECS.GetValue("cloud.instance.name"); err == nil {
Expand Down
Loading