diff --git a/metricbeat/docs/modules/mysql.asciidoc b/metricbeat/docs/modules/mysql.asciidoc index 21762cbeb66..f762f5c8642 100644 --- a/metricbeat/docs/modules/mysql.asciidoc +++ b/metricbeat/docs/modules/mysql.asciidoc @@ -58,8 +58,10 @@ in <>. Here is an example configuration: metricbeat.modules: - module: mysql metricsets: - - "status" - # - "galera_status" + - status + # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" diff --git a/metricbeat/docs/modules/mysql/performance.asciidoc b/metricbeat/docs/modules/mysql/performance.asciidoc index e0e47239f21..d94b12a53fa 100644 --- a/metricbeat/docs/modules/mysql/performance.asciidoc +++ b/metricbeat/docs/modules/mysql/performance.asciidoc @@ -9,7 +9,6 @@ beta[] include::../../../module/mysql/performance/_meta/docs.asciidoc[] -This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields diff --git a/metricbeat/docs/modules/mysql/query.asciidoc b/metricbeat/docs/modules/mysql/query.asciidoc index fd8cdf650f9..31a8e1638c1 100644 --- a/metricbeat/docs/modules/mysql/query.asciidoc +++ b/metricbeat/docs/modules/mysql/query.asciidoc @@ -9,7 +9,6 @@ beta[] include::../../../module/mysql/query/_meta/docs.asciidoc[] -This is a default metricset. If the host module is unconfigured, this metricset is enabled by default. ==== Fields diff --git a/metricbeat/metricbeat.reference.yml b/metricbeat/metricbeat.reference.yml index 2badf80ceff..92aed4ead8f 100644 --- a/metricbeat/metricbeat.reference.yml +++ b/metricbeat/metricbeat.reference.yml @@ -647,8 +647,10 @@ metricbeat.modules: #-------------------------------- MySQL Module -------------------------------- - module: mysql metricsets: - - "status" - # - "galera_status" + - status + # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" diff --git a/metricbeat/module/mysql/_meta/config.epr.yml b/metricbeat/module/mysql/_meta/config.epr.yml index 450b99a3761..3d65e506f97 100644 --- a/metricbeat/module/mysql/_meta/config.epr.yml +++ b/metricbeat/module/mysql/_meta/config.epr.yml @@ -1,7 +1,9 @@ - module: mysql metricsets: - - "status" - - "galera_status" + - status + # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" diff --git a/metricbeat/module/mysql/_meta/config.reference.yml b/metricbeat/module/mysql/_meta/config.reference.yml index 6715260a5e9..03880a5ad6a 100644 --- a/metricbeat/module/mysql/_meta/config.reference.yml +++ b/metricbeat/module/mysql/_meta/config.reference.yml @@ -1,7 +1,9 @@ - module: mysql metricsets: - - "status" - # - "galera_status" + - status + # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" diff --git a/metricbeat/module/mysql/_meta/config.yml b/metricbeat/module/mysql/_meta/config.yml index 81db7e28eed..367b32e9173 100644 --- a/metricbeat/module/mysql/_meta/config.yml +++ b/metricbeat/module/mysql/_meta/config.yml @@ -2,6 +2,8 @@ #metricsets: # - status # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" @@ -15,4 +17,4 @@ #username: root # Password of hosts. Empty by default. - #password: secret \ No newline at end of file + #password: secret diff --git a/metricbeat/module/mysql/performance/manifest.yml b/metricbeat/module/mysql/performance/manifest.yml index b88a2694cf7..51aa01614b5 100644 --- a/metricbeat/module/mysql/performance/manifest.yml +++ b/metricbeat/module/mysql/performance/manifest.yml @@ -1,4 +1,4 @@ -default: true +default: false input: module: mysql metricset: query diff --git a/metricbeat/module/mysql/query/query.go b/metricbeat/module/mysql/query/query.go index 24f09218d47..d7664cc8635 100644 --- a/metricbeat/module/mysql/query/query.go +++ b/metricbeat/module/mysql/query/query.go @@ -32,11 +32,12 @@ import ( "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/metricbeat/helper/sql" "github.com/elastic/beats/v7/metricbeat/mb" + "github.com/elastic/beats/v7/metricbeat/module/mysql" ) func init() { mb.Registry.MustAddMetricSet("mysql", "query", New, - mb.DefaultMetricSet(), + mb.WithHostParser(mysql.ParseDSN), ) } diff --git a/metricbeat/modules.d/mysql.yml.disabled b/metricbeat/modules.d/mysql.yml.disabled index 610b5830cd9..2b3371b1890 100644 --- a/metricbeat/modules.d/mysql.yml.disabled +++ b/metricbeat/modules.d/mysql.yml.disabled @@ -5,6 +5,8 @@ #metricsets: # - status # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/" @@ -18,4 +20,4 @@ #username: root # Password of hosts. Empty by default. - #password: secret \ No newline at end of file + #password: secret diff --git a/x-pack/metricbeat/metricbeat.reference.yml b/x-pack/metricbeat/metricbeat.reference.yml index 68178d0e715..45da035284f 100644 --- a/x-pack/metricbeat/metricbeat.reference.yml +++ b/x-pack/metricbeat/metricbeat.reference.yml @@ -969,8 +969,10 @@ metricbeat.modules: #-------------------------------- MySQL Module -------------------------------- - module: mysql metricsets: - - "status" - # - "galera_status" + - status + # - galera_status + # - performance + # - query period: 10s # Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"