Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

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

Merged
merged 3 commits into from
Jan 23, 2019
Merged

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

merged 3 commits into from
Jan 23, 2019

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Dec 18, 2018

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
Copy link
Member Author

ryantxu commented Dec 18, 2018

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

@ryantxu
Copy link
Member Author

ryantxu commented Dec 18, 2018

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 ryantxu changed the title Use bucket selector rather than database Use bucket selector rather than db for influx 1.7+ Dec 18, 2018
@ryantxu
Copy link
Member Author

ryantxu commented Dec 19, 2018

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

@thatguydan
Copy link

+1

@amotl
Copy link

amotl commented Jan 22, 2019

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
Copy link
Collaborator

davkal commented Jan 23, 2019

Looking at this now.

@davkal davkal merged commit e0f5f14 into grafana:master Jan 23, 2019
@amotl
Copy link

amotl commented Jan 23, 2019

Hi David,

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

Cheers,
Andreas.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants