grafana / influxdb-flux-datasource

Grafana datasource plugin for Flux (InfluxDB)
Apache License 2.0
51 stars 21 forks source link

Use `bucket` selector rather than `db` for influx 1.7+ #16

Closed ryantxu closed 5 years ago

ryantxu commented 5 years ago

It looks like the flux syntax in 1.7+ requires a bucket parameter rather than a db parameter. This patch changes db to bucket. See:

https://docs.influxdata.com/flux/v0.7/introduction/getting-started/query-influxdb/

ryantxu commented 5 years ago

I also changed the function signature to send a string and use application/vnd.flux rather than wrap things in a json object

ryantxu commented 5 years ago

To get the database test query to work it looks like all queries require a range. I put:

const query = `from(bucket:"${this.bucket}") 
        |> range(start:-10y) 
        |> last()`;

but I don't like it. any other option would be great

ryantxu commented 5 years ago

Looks like this duplicates some of @mattttt work from: https://github.com/grafana/influxdb-flux-datasource/compare/bucket-updates

thatguydan commented 5 years ago

+1

amotl commented 5 years ago

Dear @ryantxu and @davkal,

do you see any chance for merging this? #15 and #21 have been related to this guy missing from master.

Thanks, Andreas.

davkal commented 5 years ago

Looking at this now.

amotl commented 5 years ago

Hi David,

thank you so much for merging this and cutting a new release.

Cheers, Andreas.