anryko / grafana-influx-dashboard

Grafana InfluxDB scripted dashboard
MIT License
132 stars 44 forks source link

Duplicate metrics #61

Closed nordewal closed 8 years ago

nordewal commented 8 years ago

For some graphs the metrics are duplicated. Ie: 2 times cpu.idle, cpu.system, ... cpu

When looking at the query that is sent to the influxdb, I can also see that the data is actually queried twice. Note the alternation of 'type' and 'type_instance':

SELECT mean("value") FROM "cpu_value" WHERE "host" = 'myhost.example.com' AND "type" = 'percent' AND "type_instance" = 'system' AND time > now() - 6h GROUP BY time(15s) fill(none);
SELECT mean("value") FROM "cpu_value" WHERE "type" = 'percent' AND "host" = 'myhost.example.com' AND "type_instance" = 'system' AND time > now() - 6h GROUP BY time(15s) fill(none);
...
anryko commented 8 years ago

Hi @nordewal, Could you identify when the issue started to appear? Maybe there was an influxdb or collectd upgrade leading to this behavior? Unfortunately I can't reproduce the issue so I would need some help with debugging this. My first impression is that problem is with the series list returned by influxdb. Maybe there are some duplication's that I didn't consider.

Could you open a js console in your browser and investigate what happens before graph related SELECT. GetDash first gets information to match it to the configured plugins so problem must be on this stage. You would need to investigate influxdb responses to check if there are any problems.

Is there a possibility for you to copy the db, remove unrelevant data and backup a sample for me? In this case I could precisely reproduce the issue and help with solving your problem.

nordewal commented 8 years ago

Hi @anryko Thanks for the fast response. You were actually right, and I found the issue with looking at the earlier query in firebug. There I could see that there are two series with the same tags but in a different order. Like that:

cpu_value,host=myhost.example.com,type=percent,type_instance=idle cpu_value,type=percent,host=myhost.example.com,type_instance=idle

As you supposed, this is an issue that has nothing to do with getdash - I need to dig further at different places ;-)

Looks like the following: https://github.com/influxdata/influxdb/issues/6771

anryko commented 8 years ago

@nordewal, nice! Thanks.