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

[GCP] gcp.metrics always filter on resource.labels.zone even when only region is specified in the config file #33118

Closed
endorama opened this issue Sep 19, 2022 · 1 comment
Labels
bug Stalled Team:Cloud-Monitoring Label for the Cloud Monitoring team

Comments

@endorama
Copy link
Member

While working on #32943 @gpop63 correctly noticed that in gcp.metrics metricset in the metrics filter creation function in the default filter case we only rely on resource.labels.zone, not using resource.labels.region even when region is the only setting specified in the metricset configuration.

switch {
case r.config.Region != "":
region := strings.TrimSuffix(r.config.Region, "*")
f = fmt.Sprintf(`%s AND resource.labels.zone = starts_with("%s")`, f, region)
case r.config.Zone != "":
zone := strings.TrimSuffix(r.config.Zone, "*")
f = fmt.Sprintf(`%s AND resource.labels.zone = starts_with("%s")`, f, zone)
}
}

In GCP some services/resources can be of 3 types: global (available globally), regional (available in specific regions) or zonal (available in multiple zones within a region and multiple regions).

Depending on the type of the service the resource.labels map contains different keys, and from my understanding this code may results in bugs when using region setting for regional services.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 19, 2022
@endorama endorama added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Sep 19, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 19, 2022
@endorama endorama added the bug label Sep 19, 2022
@botelastic
Copy link

botelastic bot commented Sep 19, 2023

Hi!
We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1.
Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Sep 19, 2023
@botelastic botelastic bot closed this as completed Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Stalled Team:Cloud-Monitoring Label for the Cloud Monitoring team
Projects
None yet
Development

No branches or pull requests

1 participant