GithubHelp home page GithubHelp logo

grafana / influxdb-flux-datasource Goto Github PK

View Code? Open in Web Editor NEW
51.0 139.0 21.0 22.84 MB

Grafana datasource plugin for Flux (InfluxDB)

License: Apache License 2.0

JavaScript 1.66% TypeScript 25.94% Go 66.17% Shell 6.23%

influxdb-flux-datasource's Introduction

influxdb-flux-datasource's People

Contributors

briangann avatar daniellee avatar davkal avatar jtlisi avatar msarahan avatar notoriousbit avatar patrickzdarsky avatar ryantxu avatar srclosson avatar timo-schluessler avatar yves-bourgeois avatar zarbis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

influxdb-flux-datasource's Issues

Flux plugin not working with Influx 1.8

I've been trying to get Flux to connect in Grafana. I had Grafana v6.7.2, InfluxDB 1.7.10 and
grafana-influxdb-flux-datasource v5.4.1.

I couldn't get it to work, even with 'telegraf/autogen' as Default bucket, as suggested in https://community.influxdata.com/t/influxdb-error-internal-server-error-with-flux-data-source-on-grafana/11210
I was getting the error

Data source connected, but has no data. Verify the “bucket” field and make sure the bucket has data.

I tried other existing (Ithink) buckets, but nothing worked.
In the meantime, I could successfully run in CLI
influx -type=flux -username -password -execute 'from(bucket:"telegraf") |> range(start:-5m) |> filter(fn:(r) => r._measurement == "cpu")'

Then I thought, maybe there is a fix, let me update the packages. And now I'm running InfluxDB 1.8.0 and the same Flux command now returns

Error: 404 page not found
: 404 Not Found

What would be the simplest command to check connectivity? buckets()?
influx -type=flux -username -password -execute 'buckets()'

I think Flux is still enabled in my system after the update. I chose to keep the existing .conf.
$ cat /etc/influxdb/influxdb.conf | grep flux-enabled flux-enabled = true
and influx -type=flux -username <user> -password <pass> works.

Does not work together with the official piechart plugin

I have a report which creates 10 rows, all with the same timestamp but different tags.

I run the following query, to get the data from the last report run:

lastTimestamp = from(bucket: "reports")
  |> range(start: -3d)
  |> filter(fn: (r) => r._measurement == "report1" and r._field == "numPerCategory")
  |> group()
  |> last()
  |> tableFind(fn: (key) => true)
  |> getRecord(idx:0)
  
from(bucket: "reports")
  |> range(start: -3d)
  |> filter(fn: (r) => r._measurement == "report1" 
                       and r._field == "numPerCategory"
                       and r._time == lastTimestamp._time)
  |> group()
  |> yield()

If I run that query in Chronograf, it returns the desired data as a table. In Grafana, the query also works in principle: If I choose a Graph visualization, it shows the data. Of course, it doesn't draw lines, but just 10 points at the same timestamp as expected.

If I choose Pie-Chart and for the query "Format as time series", I get a pie with just one value (The one of the last queried row), not what I expected: A pie with ten values. If I choose "Format as table", the plugin crashes with "TypeError: this.datapoints is undefined".

If I change the very last |> group() to |> group(columns: ["category"]) nothing changes, same result with Format as Table or format as time series.

For reproduction: I'm on Grafana 6.7.1, using the grafana/grafana docker image and use the flux plugin via GF_INSTALL_PLUGINS on a start from scratch today.

403 Error when adding datasource

I get a Network Error: Forbidden (403) error when adding Flux as a datasource:

image

I'm using Grafana v6.1.6, InfluxDB v1.7.5 and the plugin version is v5.2.11. I've tried with and without Basic Auth but I still get the same error.

I can connect to InfluxDB using the default InfluxDB datasource with the exact same settings.

This is the InfluxDB log when trying to test the connection:

[httpd] ::1, ::1,127.0.0.1 - admin [30/Apr/2019:12:35:11 +0100] "POST /api/v2/query HTTP/1.1" 403 100 "-" "Grafana/6.1.6" 03bcb689-6b3c-11e9-8053-0050b68e29b3 0

Interestingly, when I test the default InfluxDB data source, the end point is different:

[httpd] ::1, ::1,127.0.0.1 - admin [30/Apr/2019:12:38:05 +0100] "GET /query?db=rb3043&epoch=ms&q=SHOW+RETENTION+POLICIES+on+%22rb3043%22 HTTP/1.1" 200 149 "-" "Grafana/6.1.6" 6b72a3ba-6b3c-11e9-8054-0050b68e29b3 2000

Include sub-directory when packaging the release ZIP

When using Grafana's GF_INSTALL_PLUGINS property for installing this datasource when using the grafana docker image (http://docs.grafana.org/installation/docker/), the installation fails.

Example:
GF_INSTALL_PLUGINS=https://github.com/grafana/influxdb-flux-datasource/releases/download/5.2.11/influxdb-flux-datasource-5.2.11.zip;Flux

Reason that it fails:
The release ZIP-file does not include a sub-directory. So Grafana extracts all the files directly into the "/var/libs/grafana/plugin" directory and, thus, cannot recognize the datasource correctly.

It would be great if all the content within the release ZIP files could be moved to a sub-directory of the zip-file, so this great Grafana installation feature can be used!

Thanks!

Only _value column gets formatted

I'm creating table, containing several fields. This is final part of Flux query (rest is preparing expense and profit streams):

join(tables: {expense: expense, profit: profit}, on: ["_time", "_start", "_stop", "utm_campaign"])
|> map(fn: (r) => {  
  expense: r._value_expense,
  profit: r._value_profit,
  _value: r._value_profit / r._value_expense - 1.0
})

When I try to apply formatting to resulting table in Column Styles, all formatting like decimals and thresholds is applied only to _value column regardless of whether I put formatting rules in default catch-all /.*/ rule or into explicitly named column like profit. Those non-_value columns are also sorted lexicographically despite their type is reported as double in query response.

value

I'm not an expert at Grafana code, but looking around here makes me think that _value gets hard-coded special treatment.

Unable to add Flux Datasource in Grafana V6.0

What happened: Unable to add Flux datasource in Grafana version 6.0, I'm getting Network Error (500) and Network Error (504). I have an another Grafana instance version 5.4.2, which is working fine as expected.
image

image

What you expected to happen: It should be added without any errors

How to reproduce it (as minimally and precisely as possible): Add datasource>> Update credentials >> Save and test

Anything else we need to know?:

Environment:

Grafana version: V6.0
Data source type & version: InfluxDB(Flux) datasource and version: 5.2.9
OS Grafana is installed on: Ubuntu 14
User OS & Browser: MAC and Chrome
Grafana plugins:
Others:

Avoid `dist` in master branch

The grafana plugin infrastructure seems to promote checking in dist to the master branch. This is kinda annoying and makes many pull-requests break -- since people add the dist :(

Rather than checkin dist, we could:

  1. ignore it from master
  2. make a release script that

I have a very very ugly script working here:
https://github.com/ryantxu/ajax-panel/blob/master/release.js
would be nice to get something general that could be reused across plugins :)

Plugin not compatible with Grafana 5.4.x

Plugin version v5.3.2 shows the following error on Grafana 5.4.1:

flux-datasource

Existing (and previously working) dashboards show a similar error message.

If this is simply due to the plugin toolkit changes in Grafana 5.4, it would be great if you could tag a new release of the plugin, built with the new toolkit.

Unable to create variables

Hi,

I'm trying to create variables but it's failing with the attached error.
Screen Shot 2019-03-27 at 5 22 47 PM

Only tag(telegraf,cpu) showing the result. Any idea why it's throwing the error?

Can not create new line in query editor

Hi,

I'm using Grafana v6.2.0, influxdb v1.7.4 and influxdb-flux-datasource v[5.3.0] - 2019-06-11.

When i try to create a new line in the text editor, it doesn't work and propose me the list of operator.

Has anyone also met this problem ?

thank you

image

Getting Network Error: Not Found(404)

Hello Colleagues,
As per the ticket #21 **Just run yarn install as well as yarn dev ** This works only when grafana and influxdb is running in the same host (tested works ) but our setup is both are running on a different host as docker container. Here it is not working.

Is this due to a bug -- OK and If it is bug When the fix will be available in the GA release?

No tests found with yarn test

I was expecting to find a fully working datasource plugin using grafana-toolkit, but tests in specs directory are not found by yarn test.

Repro steps

  1. git clone https://github.com/grafana/influxdb-flux-datasource.git
  2. cd influxdb-flux-datasource
  3. yarn install
  4. yarn test

Expected result

Tests in specs directory are found and run.

Actual result

$ yarn test
yarn run v1.17.3
$ grafana-toolkit plugin:test
No tests found, exiting with code 0
✔ Running tests
Done in 1.54s.

Howto add alias?

Wondering how I could alias a query to make it visually more appealing, i.e. rename data value title=HcStarts type=workinghourstotal uuid=dcbb3a00-c45a-11e6-9917-dba8816dc812 to HcStarts?

Performance issues

Generally I like idea that data is visible on the right side but...
In some cases or by mistake I get tons of data that will hang my browser... and I will loose my whole progress. Other issue I have is editing query in browser it feels laggy and super slow it would be nice to just have raw text area without any code completion annoying stuff.

image

On the bottom we see how many result tables and records thats nice info but would be nice to know execution time of query.


  • Know the execution time (ok that could be check in "Explore")
  • Disable printing raw data (don't waste memory)
  • Disable advance Flux text field
  • Disable Query
    image doesn't work :(

Thanks

Query editor broken

On OSX, both with Safari and Chrome, the query editor behaves erratic:

  • return not working (needs shift+return)
  • recurring "operators" popup
  • keyboard navigation in query textbox (often) not working
  • when text contains ^, delete and backspace (often) not working

Noticed all of there on Grafana 6.3.2.

For time being I'd propose to drop the "operators" function and instead rely on a simple but working textbox.

Provisioning does not work without undocumented fields

I was trying to provision a Flux datasource and found I needed to provide a config like:

datasources:
  - name: flux
    type: grafana-influxdb-flux-datasource
    url: http://$INFLUXDB_HOST:$INFLUXDB_PORT
    access: proxy
    jsonData:
      bucket: "my_bucket"
      url: http://$INFLUXDB_HOST:$INFLUXDB_PORT

The url and access fields are not well documented.

Internal Server Error when using filter in Flux

Hi,
Im playing with Flux (influxdb 1.7) using Grafana.

When I type

from(bucket: "iobroker")
|> range(start: -5m)

I get the data displayed… so the connection works fine.

#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,boolean,string,string #group,false,false,true,true,false,false,true,true #default,_result, ,result,table,_start,_stop,_time,_value,_field,_measurement ,0,2019-12-28T07:53:31.724972723Z,2019-12-28T07:58:31.724972723Z,2019-12-28T07:53:37.45Z,true,ack,mqtt.0.Stromzaehler_Aktuell ,0,2019-12-28T07:53:31.724972723Z,2019-12-28T07:58:31.724972723Z,2019-12-28T07:53:49.287Z,true,ack,mqtt.0.Stromzaehler_Aktuell ,0,2019-12-28T07:53:31.724972723Z,2019-12-28T07:58:31.724972723Z,2019-12-28T07:54:01.418Z,true,ack,mqtt.0.Stromzaehler_Aktuell …

But when Im starting to use any filter function, for example

from(bucket: "iobroker")
|> filter(fn: (r) => r["_measurement"] == "mqtt.0.Stromzaehler_Aktuell")
|> range(start: -5m)

I get “InfluxDB Error: Internal Server Error”.
This is the Json-Error-Object:

message:"InfluxDB Error: Internal Server Error"
data:Object
error:"Internal Server Error"
response:"error "error in building plan while starting program: cannot submit unbounded read to ""iobroker""; try bounding 'from' with a call to 'range'" "
message:"Internal Server Error"
config:Object
method:"POST"
url:"api/datasources/proxy/5/flux/api/v2/query?org=undefined"
params:Object
data:"from(bucket: "iobroker") |> filter(fn: (r) => r["_measurement"] == "mqtt.0.Stromzaehler_Aktuell") |> range(start: -5m) "
precision:"ms"

Any ideas what I did wrong???
Is it a bug?

No more compatibility with Grafana 6.3.x?

Hi,

I am running Grafana 6.3.5 and noticed that the the latest (5.4.0) version of the plugin breaks with the following error:

my-awesome-flux-dc plugin failed
Error: Fetch error: 404 Not Found Instantiating https://example.com/public/@grafana/slate-react Loading https://example.com/public/plugins/grafana-influxdb-flux-datasource/module.js Loading plugins/grafana-influxdb-flux-datasource/module

I did not find any breaking change in the release note, did I miss something?

Thank you for this great plugin, really useful.

On adding datasource getting Network error: (400)

Grafana - version 6.4.3
InfluxDB - version 1.7.8
grafana-influxdb-flux-datasource - version 5.4.1

getting the following error, with the same configs able to connect in InfluxDB as the data source

Screen Shot 2019-12-26 at 14 03 08

The expanded values of $__interval in Flux and InfluxQL are different

I made a dashboard with two graph panels. The first one uses InfluxQL and the second one Flux.

I discuss it here : https://community.grafana.com/t/flux-query-to-select-group-by-time-and-calculate-the-mean/8332

InfluxQL

SELECT mean(“usage_idle”) FROM “cpu” WHERE (“cpu” = ‘cpu-total’) AND $timeFilter GROUP BY time($__interval) fill(null)

Flux

from(db: “telegraf”)
|> filter(fn: ® => r["_measurement"] == “cpu” AND r["_field"] == “usage_idle” AND r[“cpu”] == “cpu-total”)
|> range($range)
|> window(every:$__interval)
|> mean()
|> group(none: true)

When looking at the query inspector, I see that the InfluxQL query expanded $__interval to 1m and the Flux query expanded $__interval to 15s.

Error response when adding Flux Datasource

Hi,

I am trying to use Flux as Datasource with

InfluxDB 1.7.9-1
Grafana 6.4.5
Flux-Datasource 5.4.1

I have downloaded the Plugin (grafana-influxdb-flux-datasource-5.4.1.zip) into grafana-6.4.5\data\plugins

When I try to add Flux as Datasource, I get a "Internal Server Error" message. In parallel I also use Influx as Datasource, which works well.

I examined the contents of the Plugin folder and realized it looks very different, compared to 5.3.2 version - there is no dist subfolder and also the module.js.map file is missing. Did something go wrong at this stage?

Any help would be greatly appreciated.

folder

Influx_Flux_grafana

Issu getting starting

Hi everyone !

I need to install this for fix this error when I try to use my own plugin with grafana :

Unable to dynamically transpile ES module A loader plugin needs to be configured via SystemJS.config({ transpiler: 'transpiler-module' }). Instantiating http://localhost:8080/public/plugins/grafana-checkbox-panel/module.js Loading plugins/grafana-checkbox-panel/module

but I don't really get where I'm suppose to run influxd -config I tried on my command line, located on the folder. But it doesn't work...

Could anyone help me, plz !

Best regards

Flux plugin not working with Influx 1.7

I am using influx 1.7.1 with the flux plugin 5.3.1

I observe a 404 error when trying to connect to the influx database.

Here is the output of the query:

xhrStatus:"complete"
request:Object
method:"POST"
url:"api/datasources/proxy/46/v1/query"
params:Object
orgName:"defaultorgname"
q:"from(db: "P286") |> range(start: -1h) |> limit(n:1000) "
data:null
precision:"ms"
response:"404 page not found "

I am running influx 1.7.1 and the flux plugin 5.3.1.

Stacked bars are not displayed correctly

We see that stacked bars are not displayed correctly with data coming from Flux datasource. We tested with Grafana 5.2.1 and the latest 5.3.2 - the pictures are the same.

Issue N1:

  1. Bars should start from zero, but they are "hanging" above
  2. Number of bars is not correct compared to actual data (i.e. green bars around 14:00 and below yellow lines are "ghosts" and should not be displayed).
    image
    Note: selecting one bar makes graph displaying correctly.

Source CSV data:

#datatype,string,long,string,dateTime:RFC3339,long
#group,false,false,true,false,false
#default,_result,,,,
,result,table,process_name,_time,_value
,,0,dtquery,2018-10-28T06:00:00Z,2
,,0,dtquery,2018-10-28T07:45:00Z,2
,,0,dtquery,2018-10-28T15:45:00Z,1
,,0,dtquery,2018-10-28T16:00:00Z,1
,,1,objcontrolsvc,2018-10-28T08:00:00Z,1
,,1,objcontrolsvc,2018-10-28T08:15:00Z,1
,,2,storageserver,2018-10-28T08:00:00Z,2
,,2,storageserver,2018-10-28T09:15:00Z,2
,,2,storageserver,2018-10-28T13:45:00Z,2
,,2,storageserver,2018-10-28T14:15:00Z,2
,,2,storageserver,2018-10-28T16:45:00Z,2
,,2,storageserver,2018-10-28T18:45:00Z,3
,,2,storageserver,2018-10-28T19:00:00Z,1
,,2,storageserver,2018-10-28T20:00:00Z,2
,,2,storageserver,2018-10-28T20:15:00Z,2
,,2,storageserver,2018-10-28T20:30:00Z,2
,,2,storageserver,2018-10-28T20:45:00Z,1
,,2,storageserver,2018-10-28T21:45:00Z,1
,,2,storageserver,2018-10-28T22:00:00Z,1
,,2,storageserver,2018-10-28T22:30:00Z,2
,,2,storageserver,2018-10-28T23:30:00Z,2
,,2,storageserver,2018-10-29T00:45:00Z,2

Issue N2:
Bars are getting displayed as wide rectangles
image

Source CSV data:

#datatype,string,long,string,dateTime:RFC3339,long
#group,false,false,true,false,false
#default,_result,,,,
,result,table,process_name,_time,_value
,,0,storageserver,2018-10-29T00:45:00Z,2

No possibility to hide/show graph from the same measurement

Problem:
If I have two querys from the same measurement it is not possible to show/hide one of them (in the GIF the frist panel)

If I have two querys from different measurements there is no problem two hide/show one of them. (in the GIF the second panel)

Here it is in action:
GIF

If Im using "normal" InfluxDB-Query I can also show/hide graphs from the same measurement.

Wrong variable expansion format

If when trying to use variables in queries, they are expanded in format that Flux doesn't expect, even if those variables were defined with Flux query themselves.

For example, if I use it to filter:

filter(fn: (r) =>
r.source =~ $source AND
...)

Variable will be expanded into {foo,bar,baz} while Flux expects Go-style regex like /^(foo|bar|baz)$/.

Also single choice variable will be expanded without double quotes, which also breaks Flux query. One cannot just blindly wrap variable in quotes themselves "$source" since if this variable has multiple/all checkboxes - it will break Go-style regex. Not sure how to deal with this one.

Grafana: 5.4.0
Flux Datasource: 5.2.6

Network Error: Bad Gateway(502)

Iam getting this error I save the datasource:
image

Influxdb 1.7.10 (with flux enabled with INFLUXDB_HTTP_FLUX_ENABLED=true)
Grafana 6.6.2

Document typo on README.md

Hi, there,

In README.md, section Supported Template Variable Macros:,
List all tag values for a given database should be

tag_values(database, measurement, tag) not

tag_valuess(database, measurement, tag)

I stuck here for half an hour wondering why I can't use tag values as grafana template variables.
Please fix the document, thanks.

Build is failing on Linux

Hi there,

coming from #22, @gowrisankar22 found build problems like

[email protected]: The platform "Linux" is incompatible with this module

While we related this to some Docker quirks on the first hand as building on a vanilla Debian Linux wasn't a problem for us the other day, @davkal confirmed that

building the plugin on linux is currently failing

Bummer! We will give this a short investigation to find out why this might happen.

Cheers,
Andreas.

Influx column names include every single tag

When I request values back from influx from a plugin (e.g. PictureIt) I get a weird result. Here is the query:

from(bucket: "powermon")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "modbus")
  |> filter(fn: (r) => r._field == "pv1" or r._field == "pv2" or r._field == "pv3" or r._field == "pv4" or r._field == "pv5" or r._field == "pv6" or r._field == "pv7")
  |> last()

The text result is this:

,result,table,_start,_stop,_time,_value,_field,_measurement,address,gateway,register
,_result,0,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.259Z,0.59,pv1,modbus,28,10.7.4.131,1252
,_result,1,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.348Z,0.51,pv2,modbus,28,10.7.4.131,1254
,_result,2,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.438Z,1.46,pv3,modbus,28,10.7.4.131,1256
,_result,3,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.529Z,0.45,pv4,modbus,28,10.7.4.131,1258
,_result,4,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.618Z,0.39,pv5,modbus,28,10.7.4.131,1260
,_result,5,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.709Z,0.37,pv6,modbus,28,10.7.4.131,1262
,_result,6,2020-01-30T14:57:52.00887398Z,2020-01-30T15:57:52.00887398Z,2020-01-30T15:57:44.888Z,0.04,pv7,modbus,28,10.7.4.131,1266

I intercepted the 'data-received' callback to see what I was getting (registering with base class MetrisPanelCtrl) and I see this:

{
  "alias": "modbus pv7 address=28 gateway=10.7.4.131 register=1266",
  "target": "modbus pv7 address=28 gateway=10.7.4.131 register=1266",
  "datapoints": [
    [
      0.04,
      1580399864888
    ]
  ]
}

In this particular case, what's coming back is actually a table of 7 values. Each one has a correct _field and _value and the _field name is pv1, pv2, pv3, ... in other words, it makes sense. What doesn't make sense to me is that I get this 'alias' that's everything.

Is this a bug in the driver, or minimally a difference between influx 1.7 and 2.0? Should the resultant 'target' be mapped to the _field (the actual name of the field) ?

additional range parameters

the $range parameter (as i understand it, i don't fully grok the code) is expanded in datasource.ts to start and stop values, it would be very useful to be able to split this out into two parameters such as $start and $stop as then you could(?) perform math on the start and end positions greatly simplifying and speeding up time-shifted queries

what i'm envisioning is something like

from(bucket: "telegraf/autogen")
  |> range(start:$start-1d, stop:$stop-1d)

to perform a timeshifted query to make it easy to compare from one day to the next

Better handling of empty values in tables

As of InlfuxDB 1.7.8 Flux greatly improved handling of nil values and now allows having empty cells. But Grafana's Table has problems with it:

  1. All empty values are rendered as NaNs, which is incorrect, since real NaNs appear from cases like dividing by zero and is generally a bad sign that requires attention.
  2. Sorting table is completely broken. Take a look at the same table column in Chronograf and Grafana:
    image
    image

add series override does not work

We are using flux, in order to diplay data in grafana. We had tried to use the series override for the visualization but it does not work.

Is it something already known?

we are using Grafana 6.5.2 and Influx 1.7.9 and flux v0.50. The grafana-flux plugin is v5.4.1
override

Time Series not working with value as String

In response_parser.ts the value is parsed with parseValue().

export function getTimeSeriesFromResult(result: string) {
  const { data } = parseCSV(result);
  ...
      const datapoints = series.map(record => [parseValue(record['_value']), parseTime(getTimeRec(record))]);
  ...
}

The problem is, parseValue() only allows Numbers. So if the value is a String, it returns null.

To solve this problem parseValueWithType() should be used instead.

export function getTimeSeriesFromResult(result: string) {
  const { data, types } = parseCSV(result);
  ...
      const datapoints = series.map(record => [parseValueWithType(record['_value'], types['_value']), parseTime(getTimeRec(record))]);
  ...
}

InfluxDB Error for InfluxDB 2.0

After upgrading my influxdb 2.0.0 I lost connectivity with Grafana . Now I am getting the following error "InfluxDB Error: [object Object]" at the datasource "Save & Test".

According to InfluxData they made a small modification in their API, but I could not identify where was this change.

Trying to graph two time series but only one is showing up

I have a Grafana dashboard that uses Flux to display response time and availability of various Zoom URLs over the past 24 hours.

Using Grafana version 6.7.2 on localhost, and InfluxDB Cloud 2 running on AWS Oregon.

Last weekend, I was able to plot two time-series graphs, one for the median response time of these Zoom URLs, and another for the max response time. Now I can only view the max response time.

Here's the panel in Grafana:

image

... as you can see, both time-series are being picked up in the legend (the red legend for max response time has a very long name, and green legend for median has no name) but only one is showing up.

Here's the Flux code for each of these time series, which is in the Query section of the panel:

from(bucket: "http-response")
  // Don't show the last two minutes of data, because it's possible that
  // you get a dip down to zero, due a null reading.
  |> range(start: -24h, stop: -2m)
  |> filter(fn: (r) => r._measurement == "http_response")
  |> filter(fn: (r) => r.company == "Zoom")
  |> filter(fn: (r) => r.service == "Zoom")
  |> filter(fn: (r) => r._field == "response_time")
  |> group(columns: [""], mode:"by")
  // 10m shows dips and spikes, without being too jagged to understand.
  |> aggregateWindow(every: 10m, fn: max)
  |> yield(name: "max")

from(bucket: "http-response")
  // Don't show the last two minutes of data, because it's possible that
  // you get a dip down to zero, due a null reading.
  |> range(start: -24h, stop: -2m)
  |> filter(fn: (r) => r._measurement == "http_response")
  |> filter(fn: (r) => r.company == "Zoom")
  |> filter(fn: (r) => r.service == "Zoom")
  |> filter(fn: (r) => r._field == "response_time")
  |> group(columns: [""], mode:"by")
//   10m shows dips and spikes, without being too jagged to understand.
  |> aggregateWindow(every: 10m, fn: median)
  |> yield(name: "median")

Here are the settings for the chart:

image

adding datasource getting Network Error: Not Found(404)

Hello Colleagues,
I am getting below error while adding the datasource. Could you please help me with this issue ?
influxdb and grafana running on same subnet and i can able to access the influxdb from grafana..

datasource

BRs, Gowrisankar

Alerting integration

When it will be implemented?
Is there any understanding of possible implementation?ETA?

Allow user to specify series name

This is a feature request. Check out the chart below, which has two time series legends for it:

image

The red legend, for max response time, is very long. The green legend, for median resposne time, is null.

It'd be great if I, as a dashboard builder, could somehow specify the name a series to something more readable.

As for how to solve this, a couple of possibilities come to mind:

  1. Provide a UI in the panel editor.
  2. Use the "yield" statement to determine what to use as the series name. For example, given the two yield statements below, the series names would be "max" and "median".
from(bucket: "http-response")
  // Don't show the last two minutes of data, because it's possible that
  // you get a dip down to zero, due a null reading.
  |> range(start: -24h, stop: -2m)
  |> filter(fn: (r) => r._measurement == "http_response")
  |> filter(fn: (r) => r.company == "Zoom")
  |> filter(fn: (r) => r.service == "Zoom")
  |> filter(fn: (r) => r._field == "response_time")
  |> group(columns: [""], mode:"by")
  // 10m shows dips and spikes, without being too jagged to understand.
  |> aggregateWindow(every: 10m, fn: max)
  |> yield(name: "max")

from(bucket: "http-response")
  // Don't show the last two minutes of data, because it's possible that
  // you get a dip down to zero, due a null reading.
  |> range(start: -24h, stop: -2m)
  |> filter(fn: (r) => r._measurement == "http_response")
  |> filter(fn: (r) => r.company == "Zoom")
  |> filter(fn: (r) => r.service == "Zoom")
  |> filter(fn: (r) => r._field == "response_time")
  |> group(columns: [""], mode:"by")
//   10m shows dips and spikes, without being too jagged to understand.
  |> aggregateWindow(every: 10m, fn: median)
  |> yield(name: "median")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.