[Metricbeat] Add support for multiple regions in GCP#32964
[Metricbeat] Add support for multiple regions in GCP#32964gpop63 merged 8 commits intoelastic:mainfrom
Conversation
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
endorama
left a comment
There was a problem hiding this comment.
A couple of things I think needs to be improved before merging, but overall 👍
|
|
||
| switch serviceName { | ||
| case gcp.ServiceCompute: | ||
| if r.config.Region != "" && r.config.Zone != "" { |
There was a problem hiding this comment.
This condition should take into account the case where region and regions are both configured
| } | ||
|
|
||
| f = fmt.Sprintf(`%s AND resource.labels.location = "%s"`, f, r.config.Region) | ||
| return f |
There was a problem hiding this comment.
Is this return needed? If not I would remove it there is just one return at the end (where we also log the full filter).
| f = fmt.Sprintf("%s AND %s", f, regionsFilter) | ||
| } | ||
| case gcp.ServiceGKE: | ||
| if r.config.Region != "" && r.config.Zone != "" { |
There was a problem hiding this comment.
This cThis condition should take into account the case where region and regions are both configured
| case gcp.ServiceStorage: | ||
| if r.config.Region == "" { | ||
| return f | ||
| switch { |
There was a problem hiding this comment.
Here should be added the warning about region taking precedence over regions
|
@gpop63 I notice we use a |
5883353 to
ecc40c6
Compare
* add regions config setting and pass it as argument * add services region resource label constants * add buildRegionsFilter and update getFilterForMetric logic * add getFilterForMetric and buildRegionsFilter tests * add changelog entry * minor changes for golangci-lint * add warn logs and remove redundant return * add missing argument in warnf log (cherry picked from commit 3bcefab)
|
I'm going to backport this to 7.17, otherwise this change would make our integration not compatible with the 7.x branch. |
* add regions config setting and pass it as argument * add services region resource label constants * add buildRegionsFilter and update getFilterForMetric logic * add getFilterForMetric and buildRegionsFilter tests * add changelog entry * minor changes for golangci-lint * add warn logs and remove redundant return * add missing argument in warnf log (cherry picked from commit 3bcefab) # Conflicts: # x-pack/metricbeat/module/gcp/metrics/compute/metadata.go # x-pack/metricbeat/module/gcp/metrics/metrics_requester.go # x-pack/metricbeat/module/gcp/metrics/metrics_requester_test.go # x-pack/metricbeat/module/gcp/metrics/metricset.go
|
Removing backport as backport is not needed. |
| - Add regex support for drop_fields processor. | ||
| - Improve compatibility and reduce flakyness of Python tests {pull}31588[31588] | ||
| - Added `.python-version` file {pull}32323[32323] | ||
| - Add support for multiple regions in GCP {pull}32964[32964] |
There was a problem hiding this comment.
Just saw this changelog is under developer changelog, should this be under CHANGELOG-next?
There was a problem hiding this comment.
You're right! @gpop63 may you please add this line to CHANGELOG.next with a separate PR?
* add regions config setting and pass it as argument * add services region resource label constants * add buildRegionsFilter and update getFilterForMetric logic * add getFilterForMetric and buildRegionsFilter tests * add changelog entry * minor changes for golangci-lint * add warn logs and remove redundant return * add missing argument in warnf log
What does this PR do?
Adds support for multiple regions in
GCP.Why is it important?
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs