intelsdi-x / snap-plugin-collector-disk

Collects Linux disk metrics from /proc/diskstats
http://snap-telemetry.io/
Apache License 2.0
4 stars 23 forks source link

First value is not consistent with following values #22

Closed rledisez closed 7 years ago

rledisez commented 8 years ago

Environment:

What happened: plugin disk is not consistent in metrics type. First value is sent as-is (like a type COUNTER) while following values are the differences with the previous values (like a type GAUGE). It makes it really hard to create meaningful graph because at each restart of snapd, the first value will be way higher than the others. Eg: 148146814861 -> 26 -> 24 -> 32

What you expected to happen: The first value should not be sent. Wait an interval to calculate the derivative.

Steps to reproduce it (as minimally and precisely as possible):

  1. just use the disk plugin.
IRCody commented 7 years ago

@rledisez: So your expected behavior would be the derivative and not the raw value? Can you explain why you'd prefer the derivative as opposed to the raw value?

rledisez commented 7 years ago

Yes, i'm expecting derivative. The plugin already work this way, it send derivative value, except for the first value, which is the raw value.

I would prefer the first value not to be sent, because mixing raw and derivative is inconsistent. Also, raw value is often way bigger than derivative, so it mess the graphic because with one big (raw) value, all the derivative values are so small that they are almost invisible.

IRCody commented 7 years ago

@rledisez: Can you explain why you would prefer all derivative values over all raw values? I understand that sending mixed values is an issue but it seems to me that the raw values would be more generally useful since it retains more information.

candysmurf commented 7 years ago

@rledisez, do you mind posting your task manifest so that we can give it a try to understand your points?

rledisez commented 7 years ago

@IRCody I get your point. What really matters is that values are consistent. So if you choose raw values, that's OK for me.

@candysmurf this is how the manifest looks like

---
  version: 1
  schedule:
    type: "simple"
    interval: "300s"
  max-failures: 10
  workflow:
    collect:
      metrics:
        /intel/procfs/disk/*: {}
      tags:
        /intel/procfs/disk:
          infra_id: "1"
          swift_zone: "0"
      config:
        /intel/procfs/disk:
            proc_path: /proc
      publish:
        -
          plugin_name: "opentsdb"
          config:
            host: "https://****:****@opentsdb.*****.com"
IRCody commented 7 years ago

@rledisez: Thanks for the clarification. I definitely agree it's important for the values to be consistent. Going to try to get a fix in for that soon.

candysmurf commented 7 years ago

@rledisez, thanks for the task manifest. @IzabellaRaulin submitted a PR to fix this. I'll review it today and you're welcome to try it and see if it meets your expectation.