Cherry-pick #19345 to 7.x: Accept prefix as metric_types for stackdriver metricset in GCP#19606
Merged
kaiyan-sheng merged 2 commits intoelastic:7.xfrom Jul 2, 2020
kaiyan-sheng:backport_19345_7.x
Merged
Cherry-pick #19345 to 7.x: Accept prefix as metric_types for stackdriver metricset in GCP#19606kaiyan-sheng merged 2 commits intoelastic:7.xfrom kaiyan-sheng:backport_19345_7.x
kaiyan-sheng merged 2 commits intoelastic:7.xfrom
kaiyan-sheng:backport_19345_7.x
Conversation
* Add metric_types for stackdriver metricset in GCP (cherry picked from commit 6bfe793)
Contributor
|
Pinging @elastic/integrations-platforms (Team:Platforms) |
Contributor
jsoriano
approved these changes
Jul 2, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #19345 to 7.x branch. Original message:
What does this PR do?
This PR is to add accepting prefix using
metric_typesconfig parameter intostackdrivermetricset for user to specify a prefix of the metric types instead of listing out all metric types one by one in the config.Why is it important?
This will make stackdriver configuration a lot shorter/simpler. For example, if you want to collect all instance metric types for compute service, you can use:
Instead of listing all metric types like below:
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Note: I need to spend some time on figuring out how to mock GCP APIs or add integration tests for GCP overall in a separate PR.
How to test this PR locally
Enable
googlecloudmodule and change googlecloud.yml to:Start Metricbeat and you should see these cpu metrics collected:
Note:
googlecloud.stackdriver.instance.cpu.scheduler_wait_timemight not exist because it is only available for VMs that belong to the e2 family and it's for measuring the wait time for vCPU is ready to run but unexpectedly not scheduled to run.