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

Slave lag zero (and other zero values) not picked up by collectd? #14

Open
msims-okta opened this issue Aug 29, 2016 · 3 comments
Open

Comments

@msims-okta
Copy link

There's something being dropped between the mysql plugin and collectd that I'm having a hard time tracking down.

mysql plugin verbose reports the following:
[2016-08-29 17:07:24] mysql plugin: Sending value: slave/slave_lag=0

But this metric never makes it through collectd. It just disappears. Now if the value is greater than 0, collectd passes it through just fine.

I don't see any setting where collectd drops zero valued metrics. I'm seeing this for a few other slave metrics as well. Am I missing something?

@msims-okta
Copy link
Author

msims-okta commented Dec 15, 2016

I figured it out why slave lag 0 was not being sent.

492 def dispatch_value(prefix, key, value, type, type_instance=None):
493         if not type_instance:
494                 type_instance = key
495 
496         log_verbose('Sending value: %s/%s=%s' % (prefix, type_instance, value))
497         if not value:
498                 return
499         try:
500                 value = int(value)
501         except ValueError:
502                 value = float(value)
503 
504         val               = collectd.Values(plugin='mysql', plugin_instance=prefix)
505         val.type          = type
506         val.type_instance = type_instance
507         val.values        = [value]
508         val.dispatch()

Line 497, value 0 is caught and a return is issued, causing metrics (slave_lag) with values of 0 to not be sent. If I comment out 497 and 498, the value goes through.

@cswingler
Copy link
Contributor

I submitted PR #17 to help address this earlier today

@msims-okta
Copy link
Author

msims-okta commented Dec 27, 2016

Ok cool. I haven't had time to figure out why it was getting caught there, though.
Edit: Never mind I see your PR and get it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants