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

Validate mysql hosts during -configtest #1619

Merged
merged 1 commit into from May 12, 2016

Conversation

andrewkroh
Copy link
Member

This enhances the mysql-status MetricSet to validate the DSN (data source name)
when it is constructed which occurs during -configtest. Previously an invalid DSN
would not be detected until after the MetricSet was started and it would continuously
send error events.

It adds a connect, read, and write timeout to the mysql connection.

This enhances the mysql-status MetricSet to validate the DSN (data source name)
when it is constructed which occurs during -configtest. Previously an invalid DSN
would not be detected until after the MetricSet was started and it would continuously
send error events.

It adds a connect, read, and write timeout to the mysql connection.
@@ -45,8 +45,9 @@ type MetricSet struct {
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
// Unpack additional configuration options.
config := struct {
Username string `config:"username"`
Password string `config:"password"`
Hosts []string `config:"hosts" validate:"nonzero,required"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was only added for validation of Hosts? That would probably something that should be done on the module level as it applies to all mysql metricset (yes, there is currently only one) :-)

@ruflin ruflin merged commit 1921581 into elastic:master May 12, 2016
@ruflin
Copy link
Member

ruflin commented May 12, 2016

See my comment above, that can be discussed separately.

@andrewkroh andrewkroh deleted the feature/mb/mysql-validation branch July 15, 2016 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants