Skip to content

Commit 1714b7b

Browse files
authored
[Metricbeat] Use MySQL Host Parser in Query metricset (elastic#20191)
1 parent a64e55a commit 1714b7b

File tree

11 files changed

+29
-16
lines changed

11 files changed

+29
-16
lines changed

metricbeat/docs/modules/mysql.asciidoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ in <<configuration-metricbeat>>. Here is an example configuration:
5858
metricbeat.modules:
5959
- module: mysql
6060
metricsets:
61-
- "status"
62-
# - "galera_status"
61+
- status
62+
# - galera_status
63+
# - performance
64+
# - query
6365
period: 10s
6466
6567
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"

metricbeat/docs/modules/mysql/performance.asciidoc

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ beta[]
99

1010
include::../../../module/mysql/performance/_meta/docs.asciidoc[]
1111

12-
This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.
1312

1413
==== Fields
1514

metricbeat/docs/modules/mysql/query.asciidoc

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ beta[]
99

1010
include::../../../module/mysql/query/_meta/docs.asciidoc[]
1111

12-
This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.
1312

1413
==== Fields
1514

metricbeat/metricbeat.reference.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,10 @@ metricbeat.modules:
647647
#-------------------------------- MySQL Module --------------------------------
648648
- module: mysql
649649
metricsets:
650-
- "status"
651-
# - "galera_status"
650+
- status
651+
# - galera_status
652+
# - performance
653+
# - query
652654
period: 10s
653655

654656
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"

metricbeat/module/mysql/_meta/config.epr.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- module: mysql
22
metricsets:
3-
- "status"
4-
- "galera_status"
3+
- status
4+
# - galera_status
5+
# - performance
6+
# - query
57
period: 10s
68

79
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"

metricbeat/module/mysql/_meta/config.reference.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- module: mysql
22
metricsets:
3-
- "status"
4-
# - "galera_status"
3+
- status
4+
# - galera_status
5+
# - performance
6+
# - query
57
period: 10s
68

79
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"

metricbeat/module/mysql/_meta/config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#metricsets:
33
# - status
44
# - galera_status
5+
# - performance
6+
# - query
57
period: 10s
68

79
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"
@@ -15,4 +17,4 @@
1517
#username: root
1618

1719
# Password of hosts. Empty by default.
18-
#password: secret
20+
#password: secret

metricbeat/module/mysql/performance/manifest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
default: true
1+
default: false
22
input:
33
module: mysql
44
metricset: query

metricbeat/module/mysql/query/query.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ import (
3232
"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
3333
"github.com/elastic/beats/v7/metricbeat/helper/sql"
3434
"github.com/elastic/beats/v7/metricbeat/mb"
35+
"github.com/elastic/beats/v7/metricbeat/module/mysql"
3536
)
3637

3738
func init() {
3839
mb.Registry.MustAddMetricSet("mysql", "query", New,
39-
mb.DefaultMetricSet(),
40+
mb.WithHostParser(mysql.ParseDSN),
4041
)
4142
}
4243

metricbeat/modules.d/mysql.yml.disabled

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#metricsets:
66
# - status
77
# - galera_status
8+
# - performance
9+
# - query
810
period: 10s
911

1012
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"
@@ -18,4 +20,4 @@
1820
#username: root
1921

2022
# Password of hosts. Empty by default.
21-
#password: secret
23+
#password: secret

x-pack/metricbeat/metricbeat.reference.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,10 @@ metricbeat.modules:
969969
#-------------------------------- MySQL Module --------------------------------
970970
- module: mysql
971971
metricsets:
972-
- "status"
973-
# - "galera_status"
972+
- status
973+
# - galera_status
974+
# - performance
975+
# - query
974976
period: 10s
975977

976978
# Host DSN should be defined as "user:pass@tcp(127.0.0.1:3306)/"

0 commit comments

Comments
 (0)