Skip to content

Commit

Permalink
[Metricbeat] Google Cloud: Do not try to setup region filter on Cloud…
Browse files Browse the repository at this point in the history
…functions metrics (#24218) (#24232)

(cherry picked from commit a6a3d6d)
  • Loading branch information
sayden authored Mar 1, 2021
1 parent 4c9360b commit 4fad393
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix ec2 metricset fields.yml and the integration test {pull}23726[23726]
- Unskip s3_request integration test. {pull}23887[23887]
- Add system.hostfs configuration option for system module. {pull}23831[23831]
- Fix GCP not able to request Cloudfunctions metrics if a region filter was set {pull}24218[24218]

*Packetbeat*

Expand Down
10 changes: 5 additions & 5 deletions x-pack/metricbeat/module/gcp/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const (

// Metricsets / GCP services names
const (
ServiceCompute = "compute"
ServicePubsub = "pubsub"
ServiceLoadBalancing = "loadbalancing"
ServiceFirestore = "firestore"
ServiceStorage = "storage"
ServiceCloudFunctions = "cloudfunctions"
ServiceCompute = "compute"
ServiceLoadBalancing = "loadbalancing"
ServicePubsub = "pubsub"
ServiceStorage = "storage"
)

//Paths within the GCP monitoring.TimeSeries response, if converted to JSON, where you can find each ECS field required for the output event
Expand Down
4 changes: 2 additions & 2 deletions x-pack/metricbeat/module/gcp/metrics/metrics_requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (r *metricsRequester) Metrics(ctx context.Context, sdc metricsConfig, metri
go func(mt string) {
defer wg.Done()

r.logger.Debugf("For metricType %s, metricMeta = %s", mt, metricMeta)
r.logger.Debugf("For metricType %s, metricMeta = %d", mt, metricMeta)
interval, aligner := getTimeIntervalAligner(metricMeta.ingestDelay, metricMeta.samplePeriod, r.config.period, aligner)
ts := r.Metric(ctx, mt, interval, aligner)
lock.Lock()
Expand All @@ -109,7 +109,7 @@ func (r *metricsRequester) getFilterForMetric(m string) (f string) {
service := serviceRegexp.ReplaceAllString(m, "${service}")

switch service {
case gcp.ServicePubsub, gcp.ServiceLoadBalancing:
case gcp.ServicePubsub, gcp.ServiceLoadBalancing, gcp.ServiceCloudFunctions:
return
case gcp.ServiceStorage:
if r.config.Region == "" {
Expand Down

0 comments on commit 4fad393

Please sign in to comment.