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] allow empty region/zone config param for storage metricset #17624

Merged
merged 3 commits into from
Apr 9, 2020
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 @@ -153,6 +153,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Metricbeat no longer needs to be started strictly after Logstash for `logstash-xpack` module to report correct data. {issue}17261[17261] {pull}17497[17497]
- Add privileged option so as mb to access data dir in Openshift. {pull}17606[17606]
- Fix "ID" event generator of Google Cloud module {issue}17160[17160] {pull}17608[17608]
- Fix storage metricset to allow config without region/zone. {issue}17623[17623] {pull}17624[17624]

*Packetbeat*

Expand Down
5 changes: 5 additions & 0 deletions x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ func validatePeriodForGCP(d time.Duration) (err error) {
}

func (c *config) Validate() error {
// storage metricset does not require region or zone config parameter.
if c.ServiceName == "storage" {
return nil
}

if c.Region == "" && c.Zone == "" {
return errors.New("region and zone in Google Cloud config file cannot both be empty")
}
Expand Down