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

[Metricbeat] Google Cloud: Do not try to setup region filter on Cloudfunctions metrics #24218

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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,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