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] Add region to googlecloud module config #16203

Merged
merged 8 commits into from
Feb 21, 2020
Merged

[Metricbeat] Add region to googlecloud module config #16203

merged 8 commits into from
Feb 21, 2020

Conversation

kaiyan-sheng
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng commented Feb 8, 2020

What does this PR do?

This PR is to add region as a config parameter in googlecloud module. If region is specified, instances in all zones under that region will be collected.

Why is it important?

This way, if users need to collect metrics from us-west-1a, us-west-1b and us-west-1c, they don't need to specify one section of config for each zone in googlecloud.yml. For example:

- module: googlecloud
  metricsets:
    - compute
  zone: "us-west-1a"
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 300s
- module: googlecloud
  metricsets:
    - compute
  zone: "us-west-1b"
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 300s
- module: googlecloud
  metricsets:
    - compute
  zone: "us-west-1c"
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 300s

Instead, with this PR, only region: us-west-1 is needed in the config:

- module: googlecloud
  metricsets:
    - compute
  region: "us-west-1"
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 300s

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

Use config below, googlecloud metricset should collect compute metrics from all instances under us-central1 region, which includes us-central1-a, us-central1-b, us-central1-c, and us-central1-f.

- module: googlecloud
  metricsets:
    - compute
  region: "us-central1"
  project_id: elastic-observability
  credentials_file_path: "/Users/kaiyansheng/Downloads/elastic-observability-d17781618202.json"
  exclude_labels: false
  period: 300s

Related issues

@kaiyan-sheng kaiyan-sheng requested a review from a team as a code owner February 8, 2020 03:49
@kaiyan-sheng kaiyan-sheng self-assigned this Feb 8, 2020
@kaiyan-sheng kaiyan-sheng added in progress Pull request is currently in progress. needs_backport PR is waiting to be backported to other branches. Team:Platforms Label for the Integrations - Platforms team labels Feb 8, 2020
@kaiyan-sheng kaiyan-sheng added review and removed [zube]: In Progress in progress Pull request is currently in progress. labels Feb 12, 2020
@kaiyan-sheng
Copy link
Contributor Author

kaiyan-sheng commented Feb 14, 2020

I will revisit this PR after #15598 get merged.
Update: rebase is done.

Copy link
Contributor

@sayden sayden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good! I'm impressed 😃

@kaiyan-sheng kaiyan-sheng merged commit f006db1 into elastic:master Feb 21, 2020
@kaiyan-sheng kaiyan-sheng deleted the add_region branch February 21, 2020 02:32
@kaiyan-sheng kaiyan-sheng added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Feb 21, 2020
kaiyan-sheng added a commit that referenced this pull request Feb 24, 2020
…ule config (#16492)

* [Metricbeat] Add region to googlecloud module config (#16203)
(cherry picked from commit f006db1)
@kaiyan-sheng kaiyan-sheng added the test-plan Add this PR to be manual test plan label Mar 23, 2020
@andresrc andresrc added the test-plan-added This PR has been added to the test plan label Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Team:Platforms Label for the Integrations - Platforms team test-plan Add this PR to be manual test plan test-plan-added This PR has been added to the test plan v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat] Add regions support in googlecloud module
4 participants