Package: grafana
Version: 2.6.0+dfsg-3
Severity: normal
Tags: patch

Dear Maintainer,

InfluxDB 0.11 introduced a change that makes grafana < 3.0 impossible to create 
multiple syntax
ref. : https://github.com/grafana/grafana/issues/4533

I could get it work with the attached patch, but not sure the backport is the 
correct solution here.
Beter upgrade to latest version maybe.

Best regards,


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages grafana depends on:
ii  adduser                         3.115
ii  golang-go                       2:1.6.1+1
ii  grafana-data                    2.6.0+dfsg-3
ii  init-system-helpers             1.42
ii  libc6                           2.23-4
ii  libfontconfig1 [libfontconfig]  2.11.0-6.5
ii  libsqlite3-0                    3.14.1-1

grafana recommends no packages.

grafana suggests no packages.

-- Configuration Files:
/etc/grafana/grafana.ini changed [not included]

-- no debconf information
--- a/public/app/plugins/datasource/influxdb/datasource.js	2015-12-14 15:18:01.000000000 +0100
+++ b/public/app/plugins/datasource/influxdb/datasource.js	2016-08-15 15:03:06.288666852 +0200
@@ -46,7 +46,7 @@
         query = query.replace(/\$interval/g, (target.interval || options.interval));
         return query;
 
-      }).join("\n");
+      }).join(";");
 
       // replace grafana variables
       allQueries = allQueries.replace(/\$timeFilter/g, timeFilter);
@@ -135,6 +135,16 @@
       return this._influxRequest('GET', '/query', {q: query, epoch: 'ms'});
     };
 
+    InfluxDatasource.prototype._serializeParams = function(params) {
+      if (!params) { return '';}
+  
+      return _.reduce(params, (memo, value, key) => {
+        if (value === null || value === undefined) { return memo; }
+        memo.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
+        return memo;
+      }, []).join("&");
+    };
+
     InfluxDatasource.prototype.testDatasource = function() {
       return this.metricFindQuery('SHOW MEASUREMENTS LIMIT 1').then(function () {
         return { status: "success", message: "Data source is working", title: "Success" };
@@ -168,6 +178,7 @@
         data:   data,
         precision: "ms",
         inspect: { type: 'influxdb' },
+	paramSerializer: this._serializeParams,
       };
 
       options.headers = options.headers || {};

Reply via email to