grafana / influxdb-flux-datasource

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

Store DefaultBucket setting in DatasourceSettings #114

Closed msarahan closed 4 years ago

msarahan commented 4 years ago

I'm working to get the datasource to load from a yaml file, rather than relying on the use of the UI. This bit of data seems to be missing.

I'll submit an example to the readme once I get this working. The yaml I have right now is:

# config file version
apiVersion: 1

# list of datasources to insert/update depending
# what's available in the database
datasources:
  # <string, required> name of the datasource. Required
- name: InfluxDB
  # <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
  access: proxy
  version: 1
  editable: false
  isDefault: true
  orgId: 1
  defaultBucket: rpi-sensors
  organization: <org>
  url: https://us-central1-1.gcp.cloud2.influxdata.com/
  type: grafana-influxdb-flux-datasource
  secureJsonData:
    token: <token>

I dug out the type from plugin.json: https://github.com/grafana/influxdb-flux-datasource/blob/master/src/plugin.json#L4 and it seems to work.