Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #20191 to 7.9: [Metricbeat] Use MySQL Host Parser in Query metricset #20212

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions metricbeat/docs/modules/mysql.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ in <<configuration-metricbeat>>. 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)/"
Expand Down
1 change: 0 additions & 1 deletion metricbeat/docs/modules/mysql/performance.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion metricbeat/docs/modules/mysql/query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)/"
Expand Down
6 changes: 4 additions & 2 deletions metricbeat/module/mysql/_meta/config.reference.yml
Original file line number Diff line number Diff line change
@@ -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)/"
Expand Down
4 changes: 3 additions & 1 deletion metricbeat/module/mysql/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)/"
Expand All @@ -15,4 +17,4 @@
#username: root

# Password of hosts. Empty by default.
#password: secret
#password: secret
2 changes: 1 addition & 1 deletion metricbeat/module/mysql/performance/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default: true
default: false
input:
module: mysql
metricset: query
Expand Down
3 changes: 2 additions & 1 deletion metricbeat/module/mysql/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
}

Expand Down
4 changes: 3 additions & 1 deletion metricbeat/modules.d/mysql.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -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)/"
Expand All @@ -18,4 +20,4 @@
#username: root

# Password of hosts. Empty by default.
#password: secret
#password: secret
6 changes: 4 additions & 2 deletions x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,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)/"
Expand Down