Skip to content

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

Open

Description

@msims-okta

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?

Activity

  1. msims-okta commented on Dec 15, 2016

    @msims-okta
    Author

    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.

  2. cswingler commented on Dec 19, 2016

    @cswingler
    Contributor

    I submitted PR #17 to help address this earlier today

  3. msims-okta commented on Dec 27, 2016

    @msims-okta
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions