From b9bbacfbfacd3d7f44215c922e4f2abd165f362c Mon Sep 17 00:00:00 2001 From: ruflin Date: Wed, 28 Mar 2018 13:41:54 +0200 Subject: [PATCH] Set all couchbase metricsets as default in metricbeat module. --- CHANGELOG.asciidoc | 3 ++- metricbeat/docs/modules/couchbase.asciidoc | 4 +--- metricbeat/metricbeat.reference.yml | 1 + metricbeat/module/couchbase/_meta/config.reference.yml | 5 +++++ metricbeat/module/couchbase/_meta/config.yml | 2 -- metricbeat/module/couchbase/_meta/docs.asciidoc | 2 +- metricbeat/module/couchbase/bucket/bucket.go | 7 ++++--- metricbeat/module/couchbase/cluster/cluster.go | 7 ++++--- metricbeat/module/couchbase/node/node.go | 7 ++++--- metricbeat/modules.d/couchbase.yml.disabled | 2 -- 10 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 metricbeat/module/couchbase/_meta/config.reference.yml diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index dec4547ade9e..efa568b8f086 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -272,7 +272,8 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di - Set `namespace` as default metricset in Aerospike module. {pull}6669[6669] - Set `service` as default metricset in Windows module. {pull}6675[6675] - Set all metricsets as default metricsets in uwsgi module. {pull}6688[6688] -- Mark kubernetes.event metricset as beta. {pull}[] +- Mark kubernetes.event metricset as beta. {pull}6715[6715] +- Set all metricsets as default metricsets in couchbase module. {pull}6683[6683] *Packetbeat* diff --git a/metricbeat/docs/modules/couchbase.asciidoc b/metricbeat/docs/modules/couchbase.asciidoc index db50d32bb0f2..0fb715d9af99 100644 --- a/metricbeat/docs/modules/couchbase.asciidoc +++ b/metricbeat/docs/modules/couchbase.asciidoc @@ -8,7 +8,7 @@ This file is generated! See scripts/docs_collector.py beta[] This module periodically fetches metrics from https://www.couchbase.com/[Couchbase] -servers. +servers. The default metricsets are `bucket`, `cluster`, `node`. [float] @@ -21,8 +21,6 @@ in <>. Here is an example configuration: ---- metricbeat.modules: - module: couchbase - metricsets: ["bucket", "cluster", "node"] - period: 10s hosts: ["localhost:8091"] ---- diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index dfc6e2f5a0ef..ea50f5e2e1c0 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -150,6 +150,7 @@ metricbeat.modules: metricsets: ["bucket", "cluster", "node"] period: 10s hosts: ["localhost:8091"] + enabled: true #------------------------------- Docker Module ------------------------------- - module: docker diff --git a/metricbeat/module/couchbase/_meta/config.reference.yml b/metricbeat/module/couchbase/_meta/config.reference.yml new file mode 100644 index 000000000000..1d74f195d6eb --- /dev/null +++ b/metricbeat/module/couchbase/_meta/config.reference.yml @@ -0,0 +1,5 @@ +- module: couchbase + metricsets: ["bucket", "cluster", "node"] + period: 10s + hosts: ["localhost:8091"] + enabled: true diff --git a/metricbeat/module/couchbase/_meta/config.yml b/metricbeat/module/couchbase/_meta/config.yml index 2691d77a1b4a..ea168be39717 100644 --- a/metricbeat/module/couchbase/_meta/config.yml +++ b/metricbeat/module/couchbase/_meta/config.yml @@ -1,4 +1,2 @@ - module: couchbase - metricsets: ["bucket", "cluster", "node"] - period: 10s hosts: ["localhost:8091"] diff --git a/metricbeat/module/couchbase/_meta/docs.asciidoc b/metricbeat/module/couchbase/_meta/docs.asciidoc index bd76133cd91f..08f8895a95ca 100644 --- a/metricbeat/module/couchbase/_meta/docs.asciidoc +++ b/metricbeat/module/couchbase/_meta/docs.asciidoc @@ -1,2 +1,2 @@ This module periodically fetches metrics from https://www.couchbase.com/[Couchbase] -servers. +servers. The default metricsets are `bucket`, `cluster`, `node`. diff --git a/metricbeat/module/couchbase/bucket/bucket.go b/metricbeat/module/couchbase/bucket/bucket.go index 55e7c48113b1..32783ae39330 100644 --- a/metricbeat/module/couchbase/bucket/bucket.go +++ b/metricbeat/module/couchbase/bucket/bucket.go @@ -23,9 +23,10 @@ var ( // init registers the MetricSet with the central registry. // The New method will be called after the setup of the module and before starting to fetch data func init() { - if err := mb.Registry.AddMetricSet("couchbase", "bucket", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("couchbase", "bucket", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } // MetricSet type defines all fields of the MetricSet diff --git a/metricbeat/module/couchbase/cluster/cluster.go b/metricbeat/module/couchbase/cluster/cluster.go index 1789e92008d6..7190fea5b6c6 100644 --- a/metricbeat/module/couchbase/cluster/cluster.go +++ b/metricbeat/module/couchbase/cluster/cluster.go @@ -23,9 +23,10 @@ var ( // init registers the MetricSet with the central registry. // The New method will be called after the setup of the module and before starting to fetch data func init() { - if err := mb.Registry.AddMetricSet("couchbase", "cluster", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("couchbase", "cluster", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } // MetricSet type defines all fields of the MetricSet diff --git a/metricbeat/module/couchbase/node/node.go b/metricbeat/module/couchbase/node/node.go index 92f00da61fc4..3f40985f80fa 100644 --- a/metricbeat/module/couchbase/node/node.go +++ b/metricbeat/module/couchbase/node/node.go @@ -23,9 +23,10 @@ var ( // init registers the MetricSet with the central registry. // The New method will be called after the setup of the module and before starting to fetch data func init() { - if err := mb.Registry.AddMetricSet("couchbase", "node", New, hostParser); err != nil { - panic(err) - } + mb.Registry.MustAddMetricSet("couchbase", "node", New, + mb.WithHostParser(hostParser), + mb.DefaultMetricSet(), + ) } // MetricSet type defines all fields of the MetricSet diff --git a/metricbeat/modules.d/couchbase.yml.disabled b/metricbeat/modules.d/couchbase.yml.disabled index 2691d77a1b4a..ea168be39717 100644 --- a/metricbeat/modules.d/couchbase.yml.disabled +++ b/metricbeat/modules.d/couchbase.yml.disabled @@ -1,4 +1,2 @@ - module: couchbase - metricsets: ["bucket", "cluster", "node"] - period: 10s hosts: ["localhost:8091"]