Skip to content

Commit

Permalink
resolved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Linu-Elias committed Sep 20, 2024
1 parent bbca3b2 commit fd7a7b8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Mark system process metricsets as running if metrics are partially available {pull}40565[40565]
- Added back `elasticsearch.node.stats.jvm.mem.pools.*` to the `node_stats` metricset {pull}40571[40571]
- Add GCP organization and project details to ECS cloud fields. {pull}40461[40461]
- Add `endpoint` field to the GCP configuration in order to append it to the metric client. {issue}40848[40848] {pull}40918[40918]
- Add support for specifying a custom endpoint for GCP service clients. {issue}40848[40848] {pull}40918[40918]

*Osquerybeat*

Expand Down
11 changes: 1 addition & 10 deletions metricbeat/docs/modules/gcp.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,9 @@ metricbeat.modules:
period: 24h
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
dataset_id: "dataset id"
table_pattern: "table pattern"
- module: gcp
metricsets:
- compute
region: "us-"
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
exclude_labels: false
period: 1m
----

[float]
Expand Down
11 changes: 1 addition & 10 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -641,19 +641,10 @@ metricbeat.modules:
period: 24h
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
dataset_id: "dataset id"
table_pattern: "table pattern"

- module: gcp
metricsets:
- compute
region: "us-"
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
exclude_labels: false
period: 1m

#-------------------------------- Golang Module --------------------------------
- module: golang
#metricsets:
Expand Down
11 changes: 1 addition & 10 deletions x-pack/metricbeat/module/gcp/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@
period: 24h
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
dataset_id: "dataset id"
table_pattern: "table pattern"

- module: gcp
metricsets:
- compute
region: "us-"
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
exclude_labels: false
period: 1m
2 changes: 2 additions & 0 deletions x-pack/metricbeat/module/gcp/metrics/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type config struct {
CredentialsFilePath string `config:"credentials_file_path"`
CredentialsJSON string `config:"credentials_json"`
Endpoint string `config:"endpoint"`

opt []option.ClientOption
period *durationpb.Duration
organizationID string
Expand Down Expand Up @@ -143,6 +144,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
} else {
return m, fmt.Errorf("no credentials_file_path or credentials_json specified")
}

if m.config.Endpoint != "" {
m.Logger().Warnf("You are using a custom endpoint '%s' for the GCP API calls.", m.config.Endpoint)
m.config.opt = append(m.config.opt, option.WithEndpoint(m.config.Endpoint))
Expand Down
11 changes: 1 addition & 10 deletions x-pack/metricbeat/modules.d/gcp.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@
period: 24h
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
dataset_id: "dataset id"
table_pattern: "table pattern"

- module: gcp
metricsets:
- compute
region: "us-"
project_id: "your project id"
credentials_file_path: "your JSON credentials file path"
endpoint: http://your-endpoint
exclude_labels: false
period: 1m

0 comments on commit fd7a7b8

Please sign in to comment.