CorpGlory / grafana-data-exporter

Server for fetching data from Grafana datasources
39 stars 6 forks source link

TypeError: undefined (reading 'split') queryStr #38

Open Laatem opened 2 years ago

Laatem commented 2 years ago

When I try to export my panel with InfluxDB datasource, I got this error from the grafana-data-exporter

C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:58892 this._queryParts = queryStr.split(INFLUX_QUERY_TIME_REGEX); ^

TypeError: Cannot read properties of undefined (reading 'split') at new InfluxdbMetric (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:58892:37) at metricFactory (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:58833:16) at Metric.get metricQuery [as metricQuery] (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:58855:33) at Object. (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:32426:32) at Generator.next () at C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:32379:71 at new Promise () at __awaiter (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:32375:12) at Object.queryByMetric (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:32413:12) at Exporter. (C:\Users\user\Downloads\Nouveau dossier\grafana-data-exporter-0.5.1\dist\server.js:58678:64)

But no error with the panel image

So I checked the server.js file and did a little debug, I found out that this :

js var queryStr = datasource.params.q;

So basicly here, this script try to get the param "q" from the datasource.params, but my datasource look like this params: { db: 'dataclient', epoch: 'ms' }, type: 'influxdb', datasourceId: 3 The param "q" is missing, I didn't look further, if anyone has a solution to this problem I would appreciate !

Grafana v7.0.0 InfluxDB v1.8.3 Grafana-data-exporter-panel v0.5.1 Grafana-data-exporter v0.5.1