3.1 KiB
title | seotitle | description | menu | v2 | canonical | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Use Grafana with InfluxDB | Use Grafana with InfluxDB v1.7 | Configure Grafana to query and visualize data from InfluxDB v1.7. |
|
/influxdb/v2.0/tools/grafana/ | /{{< latest "influxdb" >}}/tools/grafana/ |
Use Grafana or Grafana Cloud to visualize data from your InfluxDB v1.7 instance.
{{% note %}} The instructions in this guide require Grafana Cloud or Grafana v7.1+. For information about using InfluxDB with other versions of Grafana, see the Grafana documentation. {{% /note %}}
- Start InfluxDB.
- Sign up for Grafana Cloud or download and install Grafana.
- Visit your Grafana Cloud user interface (UI) or, if running Grafana locally,
start Grafana and visit
http://localhost:3000
in your browser. - In the left navigation of the Grafana UI, hover over the gear icon to expand the Configuration section. Click Data Sources.
- Click Add data source.
- Select InfluxDB from the list of available data sources.
- On the Data Source configuration page, enter a name for your InfluxDB data source.
- Under Query Language, select one of the following:
{{< tabs-wrapper >}}
{{% tabs %}}
InfluxQL
Flux
{{% /tabs %}}
{{% tab-content %}}
Configure Grafana to use InfluxQL
With InfluxQL selected as the query language in your InfluxDB data source settings:
-
Under HTTP, enter the following:
-
URL: Your InfluxDB URL.
http://localhost:8086/
-
Access: Server (default)
-
-
Under InfluxDB Details, enter the following:
- Database: your database name
- User: your InfluxDB username (if authentication is enabled)
- Password: your InfluxDB password (if authentication is enabled)
- HTTP Method: select GET or POST (for differences between the two, see the query HTTP endpoint documentation)
-
Provide a Min time interval (default is 10s).
{{< img-hd src="/img/influxdb/2-0-tools-grafana-influxql.png" />}}
-
Click Save & Test. Grafana attempts to connect to InfluxDB and returns the result of the test.
{{% /tab-content %}}
{{% tab-content %}}
Configure Grafana to use Flux
To query InfluxDB using Flux from Grafana, upgrade to InfluxDB 1.8.1+:
- Upgrade to InfluxDB 1.8.x
- Use Grafana with InfluxDB 1.8. {{% /tab-content %}} {{< /tabs-wrapper >}}