Provision InfluxDB

You can configure data sources using config files with Grafana’s provisioning system. You can read more about how it works and all the settings you can set for data sources on the provisioning docs page.

Here are some provisioning examples for this data source.

InfluxDB 1.x example

  1. apiVersion: 1
  2. datasources:
  3. - name: InfluxDB_v1
  4. type: influxdb
  5. access: proxy
  6. database: site
  7. user: grafana
  8. url: http://localhost:8086
  9. jsonData:
  10. httpMode: GET
  11. secureJsonData:
  12. password: grafana

InfluxDB 2.x for Flux example

  1. apiVersion: 1
  2. datasources:
  3. - name: InfluxDB_v2_Flux
  4. type: influxdb
  5. access: proxy
  6. url: http://localhost:8086
  7. secureJsonData:
  8. token: token
  9. jsonData:
  10. version: Flux
  11. organization: organization
  12. defaultBucket: bucket
  13. tlsSkipVerify: true

InfluxDB 2.x for InfluxQl example

  1. apiVersion: 1
  2. datasources:
  3. - name: InfluxDB_v2_InfluxQL
  4. type: influxdb
  5. access: proxy
  6. url: http://localhost:8086
  7. # This database should be mapped to a bucket
  8. database: site
  9. jsonData:
  10. httpMode: GET
  11. httpHeaderName1: 'Authorization'
  12. secureJsonData:
  13. httpHeaderValue1: 'Token <token>'