-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix: mysql: type conversion follow-up #9966
Conversation
Resolves #5055 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fxedel thanks for this nice PR. I have two small comments in the code. Please take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice update @fxedel! Only one more comment about the log-level. I think you should use acc.AddError()
there to make the error visible. The only exception could be an "expected" error which occurs often in certain setups, but I think that's not the case there.
plugins/inputs/mysql/mysql.go
Outdated
|
||
value, err := m.parseValueByDatabaseTypeName(colValue, col.DatabaseTypeName()) | ||
if err != nil { | ||
m.Log.Debugf("Error parsing %s=%q: %v", colName, string(colValue), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is really an error please use acc.AddError()
to make those visible. In any case, I think debugging is too invisible as you can only see those when starting telegraf in debug mode. So either acc.AddError()
or m.Log.Errorf()
here.
plugins/inputs/mysql/mysql.go
Outdated
m.Log.Debugf("Error parsing %s=%q: %v", key, string(val), err) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@srebhan Thanks for your reply. Adding errors to the accumulator to make them visible seems like a good idea. However, since Plus, I changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your work @fxedel!
(cherry picked from commit f7827a0)
Required for all PRs:
follow-up to #9403: