anryko / grafana-influx-dashboard

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

Some Grafana graphs has errros #19

Closed ruzickap closed 8 years ago

ruzickap commented 8 years ago

Hello.

I installed your dashboard into Grafana 2.1.3, but some of the graphs are giving me this error:

InfluxDB Error Response: error parsing query: aggregate function required inside the call to derivate

You can see it on the attached screenshot: grafana

I'm using grafana-2.1.3-1.x86_64, influxdb-0.9.4.1-1.x86_64, collectd-5.5.0-1.el6.x86_64.

I'm not sure if this is a dasboard bug or some problem of my collectd+influxdb configuration.

Thank you

PetrR

anryko commented 8 years ago

Hello,

Looks like your issue is due to influxdb derivative function change in v0.9.4.1. You can get more info from https://github.com/grafana/grafana/issues/2802. I will be able to fix this only after Grafana editor change is done to support this new influxdb behaviour because I don't generate query myself, just provide the data for Grafana query editor to do it for me. As a quick fix I can only suggest you to downgrade to influxdb v0.9.3 for now.

Thanks for the issue. I will live it open and will do my best at fixing it as soon as Grafana version with the new query editor feature is released.

ruzickap commented 8 years ago

Thank you for explanation. I tried the latest influxdb "influxdb-0.9.4.2-1.x86_64", but it looks like it hasn't been fixed there yet. (I'm still getting the same error like with the previous version)

I'll wait for the new influxdb release and let you know once it will start working.

Thank you

PetrR

anryko commented 8 years ago

Hey, It's not an influxdb issue in this case. They changed derivative function behaviour intentionally. We have to wait for the new Grafana release to adapt to this influxdb change and only then I can automate this functionality in getdash script.

anryko commented 8 years ago

Hi, After Grafana 2.5.0 release it still not playing nice with derivative function from Influxdb 0.9.4. However, I was tired of waiting and managed to apply some dirty hacks to make it work. I would appreciate if you could test it and confirm it works for you too.

xs4 commented 8 years ago

tested with Grafana 2.5.0 and Influxdb 0.9.4.2

It is just missing the fill(none) to be perfect. ie

diff --git a/getdash.app.js b/getdash.app.js
index c68cf98..d45e9d0 100644
--- a/getdash.app.js
+++ b/getdash.app.js
@@ -319,6 +319,8 @@ define([
         if (graphConf.math) {
             delete readyTarget.fields[0].mathExpr;
         }
+
+       readyTarget.fill = 'none';
         var queryBuilder = InfluxQueryBuilder.prototype;
         queryBuilder.target = readyTarget;
         var rawQuery = queryBuilder._buildQuery();

Without the fill none you sometimes get empty graphs.

anryko commented 8 years ago

xs4, thanks! Fixed https://github.com/anryko/grafana-influx-dashboard/commit/e582fa6b51e1d31217546becbf02b1c262c3429e

ruzickap commented 8 years ago

Working fine...

Thank you

PetrR