diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 95f0d5e7f93..dd08552554e 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -71,6 +71,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d - Add Tomcat overview dashboard {pull}14026[14026] - Move service config under metrics and simplify metric types. {pull}18691[18691] - Fix ECS compliance of user.id field in system/users metricset {pull}19019[19019] +- Rename googlecloud stackdriver metricset to metrics. {pull}19718[19718] *Packetbeat* diff --git a/libbeat/docs/release-notes/highlights/highlights-7.8.0.asciidoc b/libbeat/docs/release-notes/highlights/highlights-7.8.0.asciidoc index 054403656ea..590e5de2894 100644 --- a/libbeat/docs/release-notes/highlights/highlights-7.8.0.asciidoc +++ b/libbeat/docs/release-notes/highlights/highlights-7.8.0.asciidoc @@ -4,10 +4,10 @@ 7.8 ++++ -Each release of {beats} brings new features and product improvements. +Each release of {beats} brings new features and product improvements. Following are the most notable features and enhancements in 7.8. -For a complete list of related highlights, see the +For a complete list of related highlights, see the https://www.elastic.co/blog/elastic-observability-7-7-0-released[Observability 7.8 release blog]. For a list of bug fixes and other changes, see the {beats} @@ -25,7 +25,7 @@ For a list of bug fixes and other changes, see the {beats} In this release, we've added support for monitoring Google Cloud operations suite (formerly Stackdriver). The new -{metricbeat-ref}/metricbeat-metricset-googlecloud-stackdriver.html[stackdriver] +{metricbeat-ref}/metricbeat-metricset-googlecloud-metrics.html[metrics] metricset in the Google Cloud Platform module collects any service metrics from Google Cloud by using the `ListTimeSeries` API call. diff --git a/metricbeat/docs/fields.asciidoc b/metricbeat/docs/fields.asciidoc index 29ccf23b0b1..05d336127f5 100644 --- a/metricbeat/docs/fields.asciidoc +++ b/metricbeat/docs/fields.asciidoc @@ -18398,10 +18398,10 @@ type: object -- -*`googlecloud.stackdriver.*.*.*.*`*:: +*`googlecloud.metrics.*.*.*.*`*:: + -- -Metrics that returned from StackDriver API query. +Metrics that returned from Google Cloud API query. type: object diff --git a/metricbeat/docs/modules/googlecloud.asciidoc b/metricbeat/docs/modules/googlecloud.asciidoc index 03426f40aae..f37cc2943ef 100644 --- a/metricbeat/docs/modules/googlecloud.asciidoc +++ b/metricbeat/docs/modules/googlecloud.asciidoc @@ -145,7 +145,7 @@ For example, if Compute Metricset fetches 14 metrics (which is the number of met [float] == Metricsets -Currently, we have `compute`, `loadbalancing`, `pubsub`, `stackdriver` and +Currently, we have `compute`, `loadbalancing`, `pubsub`, `metrics` and `storage` metricset in `googlecloud` module. [float] @@ -196,10 +196,11 @@ The `pubsub` metricset comes with a predefined dashboard: image::./images/metricbeat-googlecloud-pubsub-overview.png[] [float] -=== `stackdriver` -Stackdriver provides visibility into the performance, uptime, and overall health -of cloud-powered applications. It collects metrics, events, and metadata from -different services from Google Cloud. +=== `metrics` +`metrics` metricset uses Google Cloud Operations/Stackdriver, which provides +visibility into the performance, uptime, and overall health of cloud-powered +applications. It collects metrics, events, and metadata from different services +from Google Cloud. This metricset is to collect https://cloud.google.com/monitoring/api/metrics_gcp[monitoring metrics] from Google Cloud using `ListTimeSeries` API. @@ -256,7 +257,7 @@ metricbeat.modules: - module: googlecloud metricsets: - - stackdriver + - metrics project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false @@ -280,9 +281,9 @@ The following metricsets are available: * <> -* <> +* <> -* <> +* <> * <> @@ -290,9 +291,9 @@ include::googlecloud/compute.asciidoc[] include::googlecloud/loadbalancing.asciidoc[] -include::googlecloud/pubsub.asciidoc[] +include::googlecloud/metrics.asciidoc[] -include::googlecloud/stackdriver.asciidoc[] +include::googlecloud/pubsub.asciidoc[] include::googlecloud/storage.asciidoc[] diff --git a/metricbeat/docs/modules/googlecloud/stackdriver.asciidoc b/metricbeat/docs/modules/googlecloud/metrics.asciidoc similarity index 51% rename from metricbeat/docs/modules/googlecloud/stackdriver.asciidoc rename to metricbeat/docs/modules/googlecloud/metrics.asciidoc index 16609f7b01e..2fecee9ab2b 100644 --- a/metricbeat/docs/modules/googlecloud/stackdriver.asciidoc +++ b/metricbeat/docs/modules/googlecloud/metrics.asciidoc @@ -2,12 +2,12 @@ This file is generated! See scripts/mage/docs_collector.go //// -[[metricbeat-metricset-googlecloud-stackdriver]] -=== Google Cloud Platform stackdriver metricset +[[metricbeat-metricset-googlecloud-metrics]] +=== Google Cloud Platform metrics metricset beta[] -include::../../../../x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc[] +include::../../../../x-pack/metricbeat/module/googlecloud/metrics/_meta/docs.asciidoc[] ==== Fields @@ -19,5 +19,5 @@ Here is an example document generated by this metricset: [source,json] ---- -include::../../../../x-pack/metricbeat/module/googlecloud/stackdriver/_meta/data.json[] +include::../../../../x-pack/metricbeat/module/googlecloud/metrics/_meta/data.json[] ---- diff --git a/metricbeat/docs/modules_list.asciidoc b/metricbeat/docs/modules_list.asciidoc index b6398eb65f6..6677ad12525 100644 --- a/metricbeat/docs/modules_list.asciidoc +++ b/metricbeat/docs/modules_list.asciidoc @@ -113,8 +113,8 @@ This file is generated! See scripts/mage/docs_collector.go |<> beta[] |image:./images/icon-yes.png[Prebuilt dashboards are available] | .5+| .5+| |<> beta[] |<> beta[] +|<> beta[] |<> beta[] -|<> beta[] |<> beta[] |<> |image:./images/icon-no.png[No prebuilt dashboards] | .1+| .1+| |<> diff --git a/x-pack/metricbeat/include/list.go b/x-pack/metricbeat/include/list.go index 71876550fc8..f99ce41f0f0 100644 --- a/x-pack/metricbeat/include/list.go +++ b/x-pack/metricbeat/include/list.go @@ -33,7 +33,7 @@ import ( _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/coredns" _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/coredns/stats" _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/ibmmq" _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/iis" _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/iis/application_pool" diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index ee5d7893bc0..68178d0e715 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -543,7 +543,7 @@ metricbeat.modules: - module: googlecloud metricsets: - - stackdriver + - metrics project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false diff --git a/x-pack/metricbeat/module/googlecloud/_meta/config.yml b/x-pack/metricbeat/module/googlecloud/_meta/config.yml index 87691d3a75b..d73737d93c5 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/config.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/config.yml @@ -27,7 +27,7 @@ - module: googlecloud metricsets: - - stackdriver + - metrics project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false diff --git a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc index 817045af6f8..b5a676d65ad 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/_meta/docs.asciidoc @@ -135,7 +135,7 @@ For example, if Compute Metricset fetches 14 metrics (which is the number of met [float] == Metricsets -Currently, we have `compute`, `loadbalancing`, `pubsub`, `stackdriver` and +Currently, we have `compute`, `loadbalancing`, `pubsub`, `metrics` and `storage` metricset in `googlecloud` module. [float] @@ -186,10 +186,11 @@ The `pubsub` metricset comes with a predefined dashboard: image::./images/metricbeat-googlecloud-pubsub-overview.png[] [float] -=== `stackdriver` -Stackdriver provides visibility into the performance, uptime, and overall health -of cloud-powered applications. It collects metrics, events, and metadata from -different services from Google Cloud. +=== `metrics` +`metrics` metricset uses Google Cloud Operations/Stackdriver, which provides +visibility into the performance, uptime, and overall health of cloud-powered +applications. It collects metrics, events, and metadata from different services +from Google Cloud. This metricset is to collect https://cloud.google.com/monitoring/api/metrics_gcp[monitoring metrics] from Google Cloud using `ListTimeSeries` API. diff --git a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml index 3ab4238b736..84e340de576 100644 --- a/x-pack/metricbeat/module/googlecloud/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/_meta/fields.yml @@ -24,9 +24,9 @@ - name: system.* type: object object_type: keyword - - name: "stackdriver.*.*.*.*" + - name: "metrics.*.*.*.*" type: object object_type: double object_type_mapping_type: "*" description: > - Metrics that returned from StackDriver API query. + Metrics that returned from Google Cloud API query. diff --git a/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go b/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go index 275016a383d..a91c26948d0 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/compute/compute_integration_test.go @@ -13,7 +13,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func TestData(t *testing.T) { @@ -36,7 +36,7 @@ func TestData(t *testing.T) { {"googlecloud.compute.instance.memory", "./_meta/data_memory.json"}, } - config := stackdriver.GetConfigForTest(t, "compute") + config := metrics.GetConfigForTest(t, "compute") for _, df := range dataFiles { metricSet := mbtest.NewFetcher(t, config) diff --git a/x-pack/metricbeat/module/googlecloud/compute/compute_test.go b/x-pack/metricbeat/module/googlecloud/compute/compute_test.go index d3a4f2fdf06..38519f6a51a 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/compute_test.go +++ b/x-pack/metricbeat/module/googlecloud/compute/compute_test.go @@ -11,7 +11,7 @@ import ( // Register input module and metricset _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func init() { diff --git a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml index efd7be143d3..1c688a57e78 100644 --- a/x-pack/metricbeat/module/googlecloud/compute/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/compute/manifest.yml @@ -1,7 +1,7 @@ default: true input: module: googlecloud - metricset: stackdriver + metricset: metrics defaults: metrics: - service: compute diff --git a/x-pack/metricbeat/module/googlecloud/fields.go b/x-pack/metricbeat/module/googlecloud/fields.go index e847ccdafb1..ad15833fa63 100644 --- a/x-pack/metricbeat/module/googlecloud/fields.go +++ b/x-pack/metricbeat/module/googlecloud/fields.go @@ -19,5 +19,5 @@ func init() { // AssetGooglecloud returns asset data. // This is the base64 encoded gzipped contents of module/googlecloud. func AssetGooglecloud() string { - return "eJzcXEtv2zoW3udXHHTTdpC6wMyuGFwg18XcW6CZCZC0W4Gijm2OKVLlIx731w9ISrIkW7IsS0pz001tS+T3nfc5enyALe4/wVrKNUfKpU1uAAwzHD/B2z/8t7B0X8MDJ2YlVfr2BkAhR6LxE8RoyA1AgpoqlhkmxSf47QYA4I/lA6QysRxvAFYMeaI/+R8+gCApNrd0f2afue+VtFn+TfW86rmcxMh1+XVxqoz/i9RUvj6Bq/jLufn9IZWCGamYWEOKRjGqj7doYqnisRrV4m+1n1oxub/wZRSO2OJ+J1VycuEUDUmIIVMt7qhOsrbea4PpaEsXy77RhtBtotizE3j49+a8HdTWTqSNvVWe+DVKSZYxsc4PfVNbvMOa7nOrMRtiQKGxSmACKyVTeHSIP3vEcPfwBX5YVPvFETMq08yaKqymk9U5Vt3kCFzNcZdh5ULdPU2aCW2IoHhSgc3N2xarLrhiCneE86MDuhbtWri6eKJklmESxXuDOqLSCrN4Jtw24dd35FKsWw6oifO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rQDJhdzcm2ZYYxF8kihEw/+mudMQ+yxCfeoahmJwUC1aMSZKkjEbWeT2rswfN7EU+8oTgP4wPRzjuQLKvJPOYdji4v4OnuPqNSjcwlPnlS1kCLRVgWfCWEn3FPHdLjb0sjiJ/DTSkNqT6O0HzZLsWLrKNRX4x2QNuklbGUDIaAbIlwoWEkVJjH1KFDRQSkEvz8QkZxVS5GDZgtzbUcC18S38iYFV74PO7J7dJdeeVj3ahsxjSKZfRTtW7BXO5WZ4gbLLjlN0ya8sNI6b7//ojX1NexeclF6Da9Rq4LrSoFKEeBTrS8NOk4enrseuDbzFx7i1D3NgUk9wvt9vO94RXx4JSXJpdZdZghBMr2Rx2PbvncQ5VdfWZHkQXHWwVDL1CQndDaAP1Pg7kY9NLrNc9NT27DgrMhr+ObwtDNIB4pZ2HTie7EuFWwV0ahy7Y1toChfW1I7tF5SkfUU73R5CCtfeA8pyVjvwN/96EmfJqPv8wBfkBty0MDt/VegxN8hUpG681P3TYpmIxOPohC9by2BygSbcx6xZvPrSt7Ve195FBONSZS/N4hQino8ozySRjn9yl8t5AzN+5TI31sEMbo+e62IcBk5oAEtOfI9JBZdMZn/8nb5raNydMQORepofMLbQ5xel98qRfBxIOg+5ctFrTOkbMVo5LCm1ow7EDiSfDHgSklSFWKBoUGa3S9vGG5yF72wYTDfo9c1HD/Kf603wpC3JlxJpvGdBGOFldPgfp2Wcxsf7WlIX+tUns3wy2vIUEFs6RZNTRA5G6Cc6KId9SDAP/ad96tSUPQrJGR/4wXlBFj+TmEWnkwhJp8JkzTjLjz5ByefCC8eBZHW+EsT0vHMin/VgreTKK+PX7XVH+iMV3UXZSzhvNRw/tqGF6bk/wcAAP//nHNPVA==" } diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_integration_test.go b/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_integration_test.go index c070d96a736..0c50b96f863 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_integration_test.go @@ -13,7 +13,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func TestData(t *testing.T) { @@ -34,7 +34,7 @@ func TestData(t *testing.T) { {"googlecloud.loadbalancing.tcp_ssl_proxy", "./_meta/data_tcp_ssl_proxy.json"}, } - config := stackdriver.GetConfigForTest(t, "loadbalancing") + config := metrics.GetConfigForTest(t, "loadbalancing") for _, df := range dataFiles { metricSet := mbtest.NewFetcher(t, config) diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_test.go b/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_test.go index a2d91a7a3bb..5f7ee66969d 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_test.go +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/loadbalancing_test.go @@ -11,7 +11,7 @@ import ( // Register input module and metricset _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func init() { diff --git a/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml b/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml index 9ee42ad5948..20a41824fe3 100644 --- a/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/loadbalancing/manifest.yml @@ -1,7 +1,7 @@ default: false input: module: googlecloud - metricset: stackdriver + metricset: metrics defaults: metrics: - service: loadbalancing diff --git a/x-pack/metricbeat/module/googlecloud/metrics/_meta/data.json b/x-pack/metricbeat/module/googlecloud/metrics/_meta/data.json new file mode 100644 index 00000000000..c14017dd7df --- /dev/null +++ b/x-pack/metricbeat/module/googlecloud/metrics/_meta/data.json @@ -0,0 +1,36 @@ +{ + "@timestamp": "2017-10-12T08:05:34.853Z", + "cloud": { + "account": { + "id": "elastic-apm" + }, + "instance": { + "id": "8867356942891823986", + "name": "apm-ui-dev" + }, + "provider": "googlecloud" + }, + "cloud.availability_zone": "europe-west4-a", + "event": { + "dataset": "googlecloud.metrics", + "duration": 115000, + "module": "googlecloud" + }, + "googlecloud": { + "labels": {}, + "metrics": { + "instance": { + "uptime": { + "value": 60 + } + } + } + }, + "metricset": { + "name": "metrics", + "period": 10000 + }, + "service": { + "type": "googlecloud" + } +} \ No newline at end of file diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc b/x-pack/metricbeat/module/googlecloud/metrics/_meta/docs.asciidoc similarity index 91% rename from x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc rename to x-pack/metricbeat/module/googlecloud/metrics/_meta/docs.asciidoc index 2f42a919e3d..981c1675095 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/docs.asciidoc +++ b/x-pack/metricbeat/module/googlecloud/metrics/_meta/docs.asciidoc @@ -1,11 +1,11 @@ -Stackdriver provides visibility into the performance, uptime, and overall health +Operations monitoring provides visibility into the performance, uptime, and overall health of cloud-powered applications. It collects metrics, events, and metadata from different services from Google Cloud. This metricset is to collect monitoring metrics from Google Cloud using `ListTimeSeries` API. The full list of metric types that Google Cloud monitoring supports can be found in https://cloud.google.com/monitoring/api/metrics_gcp#gcp[Google Cloud Metrics]. -Each monitoring metric from stackdriver has a sample period and/or ingest delay. +Each monitoring metric from Google Cloud has a sample period and/or ingest delay. Sample period is the time interval between consecutive data points for metrics that are written periodically. Ingest delay represents the time for data points older than this value are guaranteed to be available to read. Sample period and @@ -32,7 +32,7 @@ for the full list of aligners. [float] === Example Configuration -* `stackdriver` metricset is enabled to collect metrics from all zones under +* `metrics` metricset is enabled to collect metrics from all zones under `europe-west1-c` region in `elastic-observability` project. Two sets of metrics are specified: first one is to collect CPU usage time and utilization with aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation @@ -45,7 +45,7 @@ given aggregation aligner applied for each metric type. ---- - module: googlecloud metricsets: - - stackdriver + - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" @@ -64,7 +64,7 @@ given aggregation aligner applied for each metric type. ---- -* `stackdriver` metricset is enabled to collect metrics from all zones under +* `metrics` metricset is enabled to collect metrics from all zones under `europe-west1-c` region in `elastic-observability` project. Two sets of metrics are specified: first one is to collect CPU usage time and utilization with aggregation aligner ALIGN_MEAN; second one is to collect uptime with aggregation @@ -78,7 +78,7 @@ ignored. ---- - module: googlecloud metricsets: - - stackdriver + - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" @@ -96,7 +96,7 @@ ignored. - "instance/uptime" ---- -* `stackdriver` metricset is enabled to collect metrics from all zones under +* `metrics` metricset is enabled to collect metrics from all zones under `europe-west1-c` region in `elastic-observability` project. One set of metrics will be collected: metric types that starts with `instance/cpu` under `compute` service with aligner ALIGN_NONE. These metric types all have 240 seconds ingest @@ -112,7 +112,7 @@ every minute with no aggregation. The metric types in `compute` service with ---- - module: googlecloud metricsets: - - stackdriver + - metrics zone: "europe-west1-c" project_id: elastic-observability credentials_file_path: "your JSON credentials file path" diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/fields.yml b/x-pack/metricbeat/module/googlecloud/metrics/_meta/fields.yml similarity index 81% rename from x-pack/metricbeat/module/googlecloud/stackdriver/_meta/fields.yml rename to x-pack/metricbeat/module/googlecloud/metrics/_meta/fields.yml index e8cfd56f26f..03016c6de5d 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/fields.yml +++ b/x-pack/metricbeat/module/googlecloud/metrics/_meta/fields.yml @@ -1,5 +1,5 @@ - release: beta - key: stackdriver + key: metrics type: group description: Google Cloud Compute metrics fields: diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go b/x-pack/metricbeat/module/googlecloud/metrics/compute/identity.go similarity index 100% rename from x-pack/metricbeat/module/googlecloud/stackdriver/compute/identity.go rename to x-pack/metricbeat/module/googlecloud/metrics/compute/identity.go diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/metadata.go b/x-pack/metricbeat/module/googlecloud/metrics/compute/metadata.go similarity index 99% rename from x-pack/metricbeat/module/googlecloud/stackdriver/compute/metadata.go rename to x-pack/metricbeat/module/googlecloud/metrics/compute/metadata.go index 8bce49d12ff..67584bc002c 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/metadata.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/compute/metadata.go @@ -27,7 +27,7 @@ func NewMetadataService(projectID, zone string, region string, opt ...option.Cli region: region, opt: opt, instanceCache: common.NewCache(30*time.Second, 13), - logger: logp.NewLogger("stackdriver-compute"), + logger: logp.NewLogger("metrics-compute"), }, nil } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/compute/metadata_test.go b/x-pack/metricbeat/module/googlecloud/metrics/compute/metadata_test.go similarity index 100% rename from x-pack/metricbeat/module/googlecloud/stackdriver/compute/metadata_test.go rename to x-pack/metricbeat/module/googlecloud/metrics/compute/metadata_test.go diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/integration.go b/x-pack/metricbeat/module/googlecloud/metrics/integration.go similarity index 84% rename from x-pack/metricbeat/module/googlecloud/stackdriver/integration.go rename to x-pack/metricbeat/module/googlecloud/metrics/integration.go index 44e9405f0ce..2e79918d84e 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/integration.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/integration.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "os" @@ -34,13 +34,14 @@ func GetConfigForTest(t *testing.T, metricSetName string) map[string]interface{} "region": region, } - if metricSetName == "stackdriver" { - stackDriverConfig := stackDriverConfig{ - ServiceName: "compute", - Aligner: "ALIGN_NONE", - MetricTypes: []string{"instance/uptime"}, + if metricSetName == "metrics" { + config["metrics"] = []metricsConfig{ + { + ServiceName: "compute", + Aligner: "ALIGN_NONE", + MetricTypes: []string{"instance/uptime"}, + }, } - config["metrics"] = stackDriverConfig } } return config diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metadata_services.go b/x-pack/metricbeat/module/googlecloud/metrics/metadata_services.go similarity index 94% rename from x-pack/metricbeat/module/googlecloud/stackdriver/metadata_services.go rename to x-pack/metricbeat/module/googlecloud/metrics/metadata_services.go index b45e83b134d..717faed4854 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metadata_services.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/metadata_services.go @@ -2,11 +2,11 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver/compute" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics/compute" ) // NewMetadataServiceForConfig returns a service to fetch metadata from a config struct. It must return the Compute diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go b/x-pack/metricbeat/module/googlecloud/metrics/metrics_integration_test.go similarity index 87% rename from x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go rename to x-pack/metricbeat/module/googlecloud/metrics/metrics_integration_test.go index fd11a50c6e9..c73c3dbb023 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/stackdriver_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/metrics_integration_test.go @@ -5,7 +5,7 @@ // +build integration // +build googlecloud -package stackdriver +package metrics import ( "testing" @@ -14,7 +14,7 @@ import ( ) func TestData(t *testing.T) { - config := GetConfigForTest(t, "stackdriver") + config := GetConfigForTest(t, "metrics") metricSet := mbtest.NewFetcher(t, config) metricSet.WriteEvents(t, "/") } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go b/x-pack/metricbeat/module/googlecloud/metrics/metrics_requester.go similarity index 91% rename from x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go rename to x-pack/metricbeat/module/googlecloud/metrics/metrics_requester.go index a3f9a325038..a8be20ab2f5 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/metrics_requester.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "context" @@ -23,7 +23,7 @@ import ( "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" ) -type stackdriverMetricsRequester struct { +type metricsRequester struct { config config client *monitoring.MetricClient @@ -36,7 +36,7 @@ type timeSeriesWithAligner struct { aligner string } -func (r *stackdriverMetricsRequester) Metric(ctx context.Context, metricType string, timeInterval *monitoringpb.TimeInterval, aligner string) (out timeSeriesWithAligner) { +func (r *metricsRequester) Metric(ctx context.Context, metricType string, timeInterval *monitoringpb.TimeInterval, aligner string) (out timeSeriesWithAligner) { timeSeries := make([]*monitoringpb.TimeSeries, 0) req := &monitoringpb.ListTimeSeriesRequest{ @@ -70,7 +70,7 @@ func (r *stackdriverMetricsRequester) Metric(ctx context.Context, metricType str return } -func (r *stackdriverMetricsRequester) Metrics(ctx context.Context, sdc stackDriverConfig, metricsMeta map[string]metricMeta) ([]timeSeriesWithAligner, error) { +func (r *metricsRequester) Metrics(ctx context.Context, sdc metricsConfig, metricsMeta map[string]metricMeta) ([]timeSeriesWithAligner, error) { var lock sync.Mutex var wg sync.WaitGroup results := make([]timeSeriesWithAligner, 0) @@ -100,7 +100,7 @@ var serviceRegexp = regexp.MustCompile(`^(?P[a-z]+)\.googleapis.com.*`) // getFilterForMetric returns the filter associated with the corresponding filter. Some services like Pub/Sub fails // if they have a region specified. -func (r *stackdriverMetricsRequester) getFilterForMetric(m string) (f string) { +func (r *metricsRequester) getFilterForMetric(m string) (f string) { f = fmt.Sprintf(`metric.type="%s"`, m) if r.config.Zone == "" && r.config.Region == "" { return diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go b/x-pack/metricbeat/module/googlecloud/metrics/metrics_requester_test.go similarity index 81% rename from x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go rename to x-pack/metricbeat/module/googlecloud/metrics/metrics_requester_test.go index c256b9c0dfb..185bc8f464f 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metrics_requester_test.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/metrics_requester_test.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "testing" @@ -19,79 +19,79 @@ func TestGetFilterForMetric(t *testing.T) { cases := []struct { title string m string - r stackdriverMetricsRequester + r metricsRequester expectedFilter string }{ { "compute service with zone in config", "compute.googleapis.com/firewall/dropped_bytes_count", - stackdriverMetricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, + metricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, "metric.type=\"compute.googleapis.com/firewall/dropped_bytes_count\" AND resource.labels.zone = starts_with(\"us-central1-a\")", }, { "pubsub service with zone in config", "pubsub.googleapis.com/subscription/ack_message_count", - stackdriverMetricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, + metricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, "metric.type=\"pubsub.googleapis.com/subscription/ack_message_count\"", }, { "loadbalancing service with zone in config", "loadbalancing.googleapis.com/https/backend_latencies", - stackdriverMetricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, + metricsRequester{config: config{Zone: "us-central1-a"}, logger: logger}, "metric.type=\"loadbalancing.googleapis.com/https/backend_latencies\"", }, { "compute service with region in config", "compute.googleapis.com/firewall/dropped_bytes_count", - stackdriverMetricsRequester{config: config{Region: "us-east1"}, logger: logger}, + metricsRequester{config: config{Region: "us-east1"}, logger: logger}, "metric.type=\"compute.googleapis.com/firewall/dropped_bytes_count\" AND resource.labels.zone = starts_with(\"us-east1\")", }, { "pubsub service with region in config", "pubsub.googleapis.com/subscription/ack_message_count", - stackdriverMetricsRequester{config: config{Region: "us-east1"}, logger: logger}, + metricsRequester{config: config{Region: "us-east1"}, logger: logger}, "metric.type=\"pubsub.googleapis.com/subscription/ack_message_count\"", }, { "loadbalancing service with region in config", "loadbalancing.googleapis.com/https/backend_latencies", - stackdriverMetricsRequester{config: config{Region: "us-east1"}, logger: logger}, + metricsRequester{config: config{Region: "us-east1"}, logger: logger}, "metric.type=\"loadbalancing.googleapis.com/https/backend_latencies\"", }, { "compute service with both region and zone in config", "compute.googleapis.com/firewall/dropped_bytes_count", - stackdriverMetricsRequester{config: config{Region: "us-central1", Zone: "us-central1-a"}, logger: logger}, + metricsRequester{config: config{Region: "us-central1", Zone: "us-central1-a"}, logger: logger}, "metric.type=\"compute.googleapis.com/firewall/dropped_bytes_count\" AND resource.labels.zone = starts_with(\"us-central1\")", }, { "compute uptime with partial region", "compute.googleapis.com/instance/uptime", - stackdriverMetricsRequester{config: config{Region: "us-west"}, logger: logger}, + metricsRequester{config: config{Region: "us-west"}, logger: logger}, "metric.type=\"compute.googleapis.com/instance/uptime\" AND resource.labels.zone = starts_with(\"us-west\")", }, { "compute uptime with partial zone", "compute.googleapis.com/instance/uptime", - stackdriverMetricsRequester{config: config{Zone: "us-west1-"}, logger: logger}, + metricsRequester{config: config{Zone: "us-west1-"}, logger: logger}, "metric.type=\"compute.googleapis.com/instance/uptime\" AND resource.labels.zone = starts_with(\"us-west1-\")", }, { "compute uptime with wildcard in region", "compute.googleapis.com/instance/uptime", - stackdriverMetricsRequester{config: config{Region: "us-*"}, logger: logger}, + metricsRequester{config: config{Region: "us-*"}, logger: logger}, "metric.type=\"compute.googleapis.com/instance/uptime\" AND resource.labels.zone = starts_with(\"us-\")", }, { "compute uptime with wildcard in zone", "compute.googleapis.com/instance/uptime", - stackdriverMetricsRequester{config: config{Zone: "us-west1-*"}, logger: logger}, + metricsRequester{config: config{Zone: "us-west1-*"}, logger: logger}, "metric.type=\"compute.googleapis.com/instance/uptime\" AND resource.labels.zone = starts_with(\"us-west1-\")", }, { "compute service with no region/zone in config", "compute.googleapis.com/firewall/dropped_bytes_count", - stackdriverMetricsRequester{config: config{}, logger: logger}, + metricsRequester{config: config{}, logger: logger}, "metric.type=\"compute.googleapis.com/firewall/dropped_bytes_count\"", }, } diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go b/x-pack/metricbeat/module/googlecloud/metrics/metricset.go similarity index 90% rename from x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go rename to x-pack/metricbeat/module/googlecloud/metrics/metricset.go index a81bca2b86e..894e5734d0f 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/metricset.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/metricset.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "context" @@ -25,7 +25,7 @@ import ( const ( // MetricsetName is the name of this Metricset - MetricsetName = "stackdriver" + MetricsetName = "metrics" ) // init registers the MetricSet with the central registry as soon as the program @@ -42,14 +42,14 @@ func init() { // interface methods except for Fetch. type MetricSet struct { mb.BaseMetricSet - config config - metricsMeta map[string]metricMeta - requester *stackdriverMetricsRequester - stackDriverConfig []stackDriverConfig `config:"metrics" validate:"nonzero,required"` + config config + metricsMeta map[string]metricMeta + requester *metricsRequester + MetricsConfig []metricsConfig `config:"metrics" validate:"nonzero,required"` } -//stackDriverConfig holds a configuration specific for stackdriver metricset. -type stackDriverConfig struct { +//metricsConfig holds a configuration specific for metrics metricset. +type metricsConfig struct { ServiceName string `config:"service" validate:"required"` MetricTypes []string `config:"metric_types" validate:"required"` Aligner string `config:"aligner"` @@ -82,15 +82,15 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, err } - stackDriverConfigs := struct { - StackDriverMetrics []stackDriverConfig `config:"metrics" validate:"nonzero,required"` + metricsConfigs := struct { + Metrics []metricsConfig `config:"metrics" validate:"nonzero,required"` }{} - if err := base.Module().UnpackConfig(&stackDriverConfigs); err != nil { + if err := base.Module().UnpackConfig(&metricsConfigs); err != nil { return nil, err } - m.stackDriverConfig = stackDriverConfigs.StackDriverMetrics + m.MetricsConfig = metricsConfigs.Metrics m.config.opt = []option.ClientOption{option.WithCredentialsFile(m.config.CredentialsFilePath)} m.config.period = &duration.Duration{ Seconds: int64(m.Module().Config().Period.Seconds()), @@ -112,7 +112,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { return nil, errors.Wrap(err, "error calling metricDescriptor function") } - m.requester = &stackdriverMetricsRequester{ + m.requester = &metricsRequester{ config: m.config, client: client, logger: m.Logger(), @@ -124,8 +124,8 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) { // format. It publishes the event which is then forwarded to the output. In case // of an error set the Error field of mb.Event or simply call report.Error(). func (m *MetricSet) Fetch(ctx context.Context, reporter mb.ReporterV2) (err error) { - for _, sdc := range m.stackDriverConfig { - m.Logger().Debugf("stackdriver config: %v", sdc) + for _, sdc := range m.MetricsConfig { + m.Logger().Debugf("metrics config: %v", sdc) responses, err := m.requester.Metrics(ctx, sdc, m.metricsMeta) if err != nil { err = errors.Wrapf(err, "error trying to get metrics for project '%s' and zone '%s' or region '%s'", m.config.ProjectID, m.config.Zone, m.config.Region) @@ -196,8 +196,8 @@ func validatePeriodForGCP(d time.Duration) (err error) { return nil } -// Validate stackdriver related config -func (mc *stackDriverConfig) Validate() error { +// Validate metrics related config +func (mc *metricsConfig) Validate() error { gcpAlignerNames := make([]string, 0) for k := range googlecloud.AlignersMapToGCP { gcpAlignerNames = append(gcpAlignerNames, k) @@ -219,7 +219,7 @@ func (m *MetricSet) metricDescriptor(ctx context.Context, client *monitoring.Met Name: "projects/" + m.config.ProjectID, } - for _, sdc := range m.stackDriverConfig { + for _, sdc := range m.MetricsConfig { for _, mt := range sdc.MetricTypes { req.Filter = fmt.Sprintf(`metric.type = starts_with("%s")`, sdc.ServiceName+".googleapis.com/"+mt) it := client.ListMetricDescriptors(ctx, req) diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go b/x-pack/metricbeat/module/googlecloud/metrics/response_parser.go similarity index 99% rename from x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go rename to x-pack/metricbeat/module/googlecloud/metrics/response_parser.go index b6e38f4d333..3ab2ba9018a 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/response_parser.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "regexp" diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go b/x-pack/metricbeat/module/googlecloud/metrics/response_parser_test.go similarity index 98% rename from x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go rename to x-pack/metricbeat/module/googlecloud/metrics/response_parser_test.go index 2b641151270..f9949aad962 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/response_parser_test.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/response_parser_test.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "testing" diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go b/x-pack/metricbeat/module/googlecloud/metrics/timeseries.go similarity index 99% rename from x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go rename to x-pack/metricbeat/module/googlecloud/metrics/timeseries.go index c0b456f9954..f96b8fcb767 100644 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/timeseries.go +++ b/x-pack/metricbeat/module/googlecloud/metrics/timeseries.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -package stackdriver +package metrics import ( "context" diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml b/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml index 5bf1842e200..7cabb2f2085 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/pubsub/manifest.yml @@ -1,7 +1,7 @@ default: true input: module: googlecloud - metricset: stackdriver + metricset: metrics defaults: metrics: - service: pubsub diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_integration_test.go b/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_integration_test.go index 6d739326dea..7ccb71e93d3 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_integration_test.go @@ -13,7 +13,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func TestData(t *testing.T) { @@ -34,7 +34,7 @@ func TestData(t *testing.T) { {"googlecloud.pubsub.topic", "./_meta/data_topic.json"}, } - config := stackdriver.GetConfigForTest(t, "pubsub") + config := metrics.GetConfigForTest(t, "pubsub") for _, df := range dataFiles { metricSet := mbtest.NewFetcher(t, config) diff --git a/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_test.go b/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_test.go index eed29ca1661..84dc87cdf6c 100644 --- a/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_test.go +++ b/x-pack/metricbeat/module/googlecloud/pubsub/pubsub_test.go @@ -11,7 +11,7 @@ import ( // Register input module and metricset _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func init() { diff --git a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/data.json b/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/data.json deleted file mode 100644 index 363f4347d8f..00000000000 --- a/x-pack/metricbeat/module/googlecloud/stackdriver/_meta/data.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "@timestamp": "2017-10-12T08:05:34.853Z", - "cloud": { - "account": { - "id": "elastic-observability" - }, - "instance": { - "id": "2917397443238883901", - "name": "gke-observability-8--observability-8--bc1afd95-fv5w" - }, - "machine": { - "type": "n1-standard-4" - }, - "provider": "googlecloud" - }, - "cloud.availability_zone": "europe-west1-c", - "event": { - "dataset": "googlecloud.stackdriver", - "duration": 115000, - "module": "googlecloud" - }, - "googlecloud": { - "labels": { - "user": { - "goog-gke-node": "" - } - }, - "stackdriver": { - "instance": { - "uptime": 60 - } - } - }, - "metricset": { - "name": "stackdriver", - "period": 10000 - }, - "service": { - "type": "googlecloud" - } -} \ No newline at end of file diff --git a/x-pack/metricbeat/module/googlecloud/storage/manifest.yml b/x-pack/metricbeat/module/googlecloud/storage/manifest.yml index 778624aea83..26d3d4f5e5f 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/manifest.yml +++ b/x-pack/metricbeat/module/googlecloud/storage/manifest.yml @@ -1,7 +1,7 @@ default: false input: module: googlecloud - metricset: stackdriver + metricset: metrics defaults: metrics: - service: storage diff --git a/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go b/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go index 7d40e7b2bf9..a057d9642c1 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go +++ b/x-pack/metricbeat/module/googlecloud/storage/storage_integration_test.go @@ -13,7 +13,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" - "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func TestData(t *testing.T) { @@ -34,7 +34,7 @@ func TestData(t *testing.T) { {"googlecloud.storage.storage", "./_meta/data_storage.json"}, } - config := stackdriver.GetConfigForTest(t, "storage") + config := metrics.GetConfigForTest(t, "storage") for _, df := range dataFiles { metricSet := mbtest.NewFetcher(t, config) diff --git a/x-pack/metricbeat/module/googlecloud/storage/storage_test.go b/x-pack/metricbeat/module/googlecloud/storage/storage_test.go index 5fb9259bc28..371c3a90600 100644 --- a/x-pack/metricbeat/module/googlecloud/storage/storage_test.go +++ b/x-pack/metricbeat/module/googlecloud/storage/storage_test.go @@ -11,7 +11,7 @@ import ( // Register input module and metricset _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud" - _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/stackdriver" + _ "github.com/elastic/beats/v7/x-pack/metricbeat/module/googlecloud/metrics" ) func init() { diff --git a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled index 9e7654cc4f7..266b2b0cd12 100644 --- a/x-pack/metricbeat/modules.d/googlecloud.yml.disabled +++ b/x-pack/metricbeat/modules.d/googlecloud.yml.disabled @@ -30,7 +30,7 @@ - module: googlecloud metricsets: - - stackdriver + - metrics project_id: "your project id" credentials_file_path: "your JSON credentials file path" exclude_labels: false