Merge pull request #6407 from influxdata/6406-grafana-configuration-outline-and-draft-documentation
Grafana configuration screenshot and instructions update6442-v3-odbc-powerbi
|
|
@ -14,14 +14,19 @@ canonical: /influxdb/v2/tools/grafana/
|
||||||
Use [Grafana](https://grafana.com/) or [Grafana Cloud](https://grafana.com/products/cloud/)
|
Use [Grafana](https://grafana.com/) or [Grafana Cloud](https://grafana.com/products/cloud/)
|
||||||
to visualize data from your **InfluxDB Enterprise** cluster.
|
to visualize data from your **InfluxDB Enterprise** cluster.
|
||||||
|
|
||||||
{{% note %}}
|
> [!Note]
|
||||||
#### Required
|
> #### Required
|
||||||
- The instructions in this guide require **Grafana Cloud** or **Grafana v10.3+**.
|
> - The instructions in this guide require **Grafana Cloud** or **Grafana v10.3+**.
|
||||||
For information about using InfluxDB with other versions of Grafana,
|
> For information about using InfluxDB with other versions of Grafana,
|
||||||
see the [Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/influxdb/).
|
> see the [Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/influxdb/).
|
||||||
- To use **Flux**, use **InfluxDB 1.8.1+** and [enable Flux](/influxdb/v1/flux/installation/)
|
> - To use **Flux**, use **InfluxDB 1.8.1+** and [enable Flux](/enterprise_influxdb/v1/flux/installation/)
|
||||||
in your InfluxDB configuration file.
|
> in your InfluxDB data nodes.
|
||||||
{{% /note %}}
|
|
||||||
|
- [Install Grafana](#install-grafana)
|
||||||
|
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
||||||
|
- [Query and visualize data](#query-and-visualize-data)
|
||||||
|
|
||||||
|
## Install Grafana
|
||||||
|
|
||||||
1. [Set up an InfluxDB Enterprise cluster](/enterprise_influxdb/v1/introduction/installation/).
|
1. [Set up an InfluxDB Enterprise cluster](/enterprise_influxdb/v1/introduction/installation/).
|
||||||
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
||||||
|
|
@ -29,107 +34,91 @@ to visualize data from your **InfluxDB Enterprise** cluster.
|
||||||
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
||||||
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
||||||
<http://localhost:3000> in your browser.
|
<http://localhost:3000> in your browser.
|
||||||
4. In the left navigation of the Grafana UI, expand the **Connections** section
|
|
||||||
and click **Add new connection**.
|
|
||||||
5. Select **InfluxDB** from the list of available data sources and click
|
|
||||||
**Add data source**.
|
|
||||||
6. On the **Data Source configuration page**, enter a **name** for your InfluxDB data source.
|
|
||||||
7. In the **Query Language** drop-down menu, select one of the query languages
|
|
||||||
supported by InfluxDB {{< current-version >}} (InfluxQL or Flux):
|
|
||||||
|
|
||||||
{{% note %}}
|
> [!Note]
|
||||||
SQL is only supported in InfluxDB 3.
|
> #### Query language support
|
||||||
{{% /note %}}
|
> - InfluxQL is supported in InfluxDB Enterprise v1.8.x and later.
|
||||||
|
> - Flux is supported in InfluxDB Enterprise v1.8.1 and later.
|
||||||
|
> - SQL is only supported in InfluxDB 3.
|
||||||
|
|
||||||
|
## Create an InfluxDB data source
|
||||||
|
|
||||||
|
1. In your Grafana interface, click **Connections** in the left sidebar
|
||||||
|
2. Click **Data sources**
|
||||||
|
3. In the **Data sources** page, click **Add new data source**
|
||||||
|
4. In the **Add data source** page, locate and click the **InfluxDB** card
|
||||||
|
|
||||||
|
The InfluxDB configuration page displays with four numbered sections in the left sidebar:
|
||||||
|
|
||||||
|
1. **URL and authentication**
|
||||||
|
2. **Database settings**
|
||||||
|
3. **Private data source connect**
|
||||||
|
4. **Save & test**
|
||||||
|
5. Click **Add new connection**
|
||||||
|
6. Locate and click the **InfluxDB** card
|
||||||
|
|
||||||
|
The InfluxDB configuration page displays with four numbered sections in the left sidebar.
|
||||||
|
|
||||||
|
7. **Name**: Enter a descriptive name for your data source
|
||||||
|
8. **URL**: Enter your InfluxDB Enterprise URL or load balancer URL: `http://localhost:8086`
|
||||||
|
9. **Product**: From the dropdown, select **InfluxDB Enterprise 1.x**
|
||||||
|
10. **Query Language**: Select **InfluxQL** or **Flux**
|
||||||
|
|
||||||
|
After selecting your query language, section 2 (Database settings) displays fields specific to your selection.
|
||||||
|
|
||||||
|
### Configure database settings
|
||||||
|
|
||||||
|
The fields in this section change based on your query language selection.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
[InfluxQL](#)
|
[InfluxQL](#)
|
||||||
[Flux](#)
|
[Flux](#)
|
||||||
{{% /tabs %}}
|
{{% /tabs %}}
|
||||||
<!--------------------------- BEGIN INFLUXQL CONTENT -------------------------->
|
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!--------------------------- BEGIN INFLUXQL CONTENT -------------------------->
|
||||||
|
|
||||||
## Configure Grafana to use InfluxQL
|
## Configure Grafana to use InfluxQL
|
||||||
|
|
||||||
With **InfluxQL** selected as the query language in your InfluxDB data source settings:
|
When you select **InfluxQL** as the query language, configure the following:
|
||||||
|
|
||||||
1. Under **HTTP**, enter the following:
|
- **Database**: Your database name
|
||||||
|
- **User**: Your InfluxDB username _(if [authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/))_
|
||||||
|
- **Password**: Your InfluxDB password _(if [authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/))_
|
||||||
|
|
||||||
- **URL**: Your **InfluxDB Enterprise URL** or **load balancer URL**.
|
{{< img-hd src="/img/influxdb3/enterprise-v1-grafana-product-dropdown-flux.png" alt="InfluxQL configuration for InfluxDB Enterprise 1.x" />}}
|
||||||
|
|
||||||
```sh
|
Click **Save & Test**. Grafana attempts to connect to InfluxDB Enterprise and returns the result of the test.
|
||||||
http://localhost:8086
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Under **InfluxDB Details**, enter the following:
|
|
||||||
|
|
||||||
- **Database**: your database name
|
|
||||||
- **User**: your InfluxDB username _(if [authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/))_
|
|
||||||
- **Password**: your InfluxDB password _(if [authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/))_
|
|
||||||
- **HTTP Method**: Select **GET** or **POST** _(for differences between the two,
|
|
||||||
see the [query HTTP endpoint documentation](/enterprise_influxdb/v1/tools/api/#query-http-endpoint))_
|
|
||||||
|
|
||||||
3. Provide a **[Min time interval](https://grafana.com/docs/grafana/latest/datasources/influxdb/#min-time-interval)**
|
|
||||||
(default is 10s).
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb/v1-tools-grafana-influxql.png" />}}
|
|
||||||
|
|
||||||
4. Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns
|
|
||||||
the result of the test.
|
|
||||||
|
|
||||||
{{% /tab-content %}}
|
|
||||||
<!---------------------------- END INFLUXQL CONTENT --------------------------->
|
<!---------------------------- END INFLUXQL CONTENT --------------------------->
|
||||||
<!----------------------------- BEGIN FLUX CONTENT ---------------------------->
|
{{% /tab-content %}}
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!----------------------------- BEGIN FLUX CONTENT ---------------------------->
|
||||||
|
|
||||||
## Configure Grafana to use Flux
|
## Configure Grafana to use Flux
|
||||||
|
|
||||||
With **Flux** selected as the query language in your InfluxDB data source,
|
When you select **Flux** as the query language, configure the following:
|
||||||
configure your InfluxDB connection:
|
|
||||||
|
|
||||||
1. Ensure [Flux is enabled](/enterprise_influxdb/v1/flux/installation/) in
|
1. Ensure [Flux is enabled](/enterprise_influxdb/v1/flux/installation/) in your InfluxDB Enterprise data nodes.
|
||||||
your InfluxDB Enterprise data nodes.
|
|
||||||
|
|
||||||
2. Under **HTTP**, enter the following:
|
2. Configure the database settings:
|
||||||
|
|
||||||
- **URL**: Your **InfluxDB Enterprise URL** or **load balancer URL**.
|
- **Organization**: Provide an arbitrary value (InfluxDB Enterprise 1.x does not use organizations)
|
||||||
|
- **Default Bucket**: Provide a default database and retention policy
|
||||||
|
- **Token**: If [InfluxDB authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/)
|
||||||
|
|
||||||
```sh
|
{{< img-hd src="/img/influxdb3/enterprise-v1-grafana-product-dropdown-flux.png" alt="Flux configuration for InfluxDB Enterprise 1.x" />}}
|
||||||
http://localhost:8086
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Under **InfluxDB Details**, enter the following:
|
Click **Save & Test**. Grafana attempts to connect to InfluxDB Enterprise and returns the result of the test.
|
||||||
|
|
||||||
- **Organization**: Provide an arbitrary value.
|
|
||||||
- **Token**: If [InfluxDB authentication is enabled](/enterprise_influxdb/v1/administration/authentication_and_authorization/),
|
|
||||||
provide your InfluxDB username and password using the following syntax:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Syntax
|
|
||||||
username:password
|
|
||||||
|
|
||||||
# Example
|
|
||||||
johndoe:mY5uP3rS3crE7pA5Sw0Rd
|
|
||||||
```
|
|
||||||
|
|
||||||
If authentication is not enabled, leave blank.
|
|
||||||
|
|
||||||
- **Default Bucket**: Provide a default database and retention policy combination
|
|
||||||
using the following syntax:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Syntax
|
|
||||||
database-name/retention-policy-name
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
example-db/example-rp
|
|
||||||
telegraf/autogen
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Min time interval**: [Grafana minimum time interval](https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#min-time-interval).
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb/v1-tools-grafana-flux.png" />}}
|
|
||||||
|
|
||||||
3. Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns
|
|
||||||
the result of the test.
|
|
||||||
{{% /tab-content %}}
|
|
||||||
<!------------------------------ END FLUX CONTENT ----------------------------->
|
<!------------------------------ END FLUX CONTENT ----------------------------->
|
||||||
|
{{% /tab-content %}}
|
||||||
{{< /tabs-wrapper >}}
|
{{< /tabs-wrapper >}}
|
||||||
|
|
||||||
|
## Query and visualize data
|
||||||
|
|
||||||
|
With your InfluxDB connection configured, use Grafana to query and visualize time series data.
|
||||||
|
|
||||||
|
For more information, see:
|
||||||
|
- [Grafana documentation](https://grafana.com/docs/grafana/latest/)
|
||||||
|
- [Get started with Flux](/flux/v0/get-started/)
|
||||||
|
|
@ -25,112 +25,92 @@ to visualize data from your **InfluxDB v1.11** instance.
|
||||||
in your InfluxDB configuration file.
|
in your InfluxDB configuration file.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
- [Install Grafana](#install-grafana)
|
||||||
|
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
||||||
|
- [Query and visualize data](#query-and-visualize-data)
|
||||||
|
|
||||||
|
## Install Grafana
|
||||||
|
|
||||||
1. [Start InfluxDB](/influxdb/v1/introduction/get-started/).
|
1. [Start InfluxDB](/influxdb/v1/introduction/get-started/).
|
||||||
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
||||||
[download and install Grafana](https://grafana.com/grafana/download).
|
[download and install Grafana](https://grafana.com/grafana/download).
|
||||||
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
||||||
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
||||||
<http://localhost:3000> in your browser.
|
<http://localhost:3000> in your browser.
|
||||||
4. In the left navigation of the Grafana UI, expand the **Connections** section
|
|
||||||
and click **Add new connection**.
|
|
||||||
5. Select **InfluxDB** from the list of available data sources and click
|
|
||||||
**Add data source**.
|
|
||||||
6. On the **Data Source configuration page**, enter a **name** for your InfluxDB data source.
|
|
||||||
7. In the **Query Language** drop-down menu, select one of the query languages
|
|
||||||
supported by InfluxDB {{< current-version >}} (InfluxQL or Flux):
|
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
SQL is only supported in InfluxDB 3.
|
SQL is only supported in InfluxDB 3.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
## Create an InfluxDB data source
|
||||||
|
|
||||||
|
1. In your Grafana interface, click **Connections** in the left sidebar
|
||||||
|
2. Click **Data sources**
|
||||||
|
3. Click **Add new connection**
|
||||||
|
4. Locate and click the **InfluxDB** card
|
||||||
|
|
||||||
|
The InfluxDB configuration page displays with four numbered sections in the left sidebar.
|
||||||
|
|
||||||
|
5. **Name**: Enter a descriptive name for your data source
|
||||||
|
6. **URL**: Enter your InfluxDB URL: `http://localhost:8086`
|
||||||
|
7. **Product**: From the dropdown, select **InfluxDB OSS 1.x**
|
||||||
|
8. **Query Language**: Select **InfluxQL** or **Flux**
|
||||||
|
|
||||||
|
After selecting your query language, section 2 (Database settings) displays fields specific to your selection.
|
||||||
|
|
||||||
|
### Configure database settings
|
||||||
|
|
||||||
|
The fields in this section change based on your query language selection.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
[InfluxQL](#)
|
[InfluxQL](#)
|
||||||
[Flux](#)
|
[Flux](#)
|
||||||
{{% /tabs %}}
|
{{% /tabs %}}
|
||||||
<!--------------------------- BEGIN INFLUXQL CONTENT -------------------------->
|
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!--------------------------- BEGIN INFLUXQL CONTENT -------------------------->
|
||||||
|
|
||||||
## Configure Grafana to use InfluxQL
|
## Configure Grafana to use InfluxQL
|
||||||
|
|
||||||
With **InfluxQL** selected as the query language in your InfluxDB data source settings:
|
When you select **InfluxQL** as the query language, configure the following:
|
||||||
|
|
||||||
1. Under **HTTP**, enter the following:
|
- **Database**: Your database name
|
||||||
|
- **User**: Your InfluxDB username _(if [authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/)); leave blank if authentication is disabled._
|
||||||
|
- **Password**: Your InfluxDB password _(if [authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/)); leave blank if authentication is disabled._
|
||||||
|
|
||||||
- **URL**: Your **InfluxDB URL**.
|
{{< img-hd src="/img/influxdb3/OSS-v1-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for InfluxDB OSS 1.x" />}}
|
||||||
|
|
||||||
```sh
|
Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns the result of the test.
|
||||||
http://localhost:8086
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Under **InfluxDB Details**, enter the following:
|
|
||||||
|
|
||||||
- **Database**: your database name
|
|
||||||
- **User**: your InfluxDB username _(if [authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/))_
|
|
||||||
- **Password**: your InfluxDB password _(if [authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/))_
|
|
||||||
- **HTTP Method**: Select **GET** or **POST** _(for differences between the two,
|
|
||||||
see the [query HTTP endpoint documentation](/influxdb/v1/tools/api/#query-http-endpoint))_
|
|
||||||
|
|
||||||
3. Provide a **[Min time interval](https://grafana.com/docs/grafana/latest/datasources/influxdb/#min-time-interval)**
|
|
||||||
(default is 10s).
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb/v1-tools-grafana-influxql.png" />}}
|
|
||||||
|
|
||||||
4. Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns
|
|
||||||
the result of the test.
|
|
||||||
|
|
||||||
{{% /tab-content %}}
|
|
||||||
<!---------------------------- END INFLUXQL CONTENT --------------------------->
|
<!---------------------------- END INFLUXQL CONTENT --------------------------->
|
||||||
<!----------------------------- BEGIN FLUX CONTENT ---------------------------->
|
{{% /tab-content %}}
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!----------------------------- BEGIN FLUX CONTENT ---------------------------->
|
||||||
|
|
||||||
## Configure Grafana to use Flux
|
## Configure Grafana to use Flux
|
||||||
|
|
||||||
With **Flux** selected as the query language in your InfluxDB data source,
|
When you select **Flux** as the query language, configure the following:
|
||||||
configure your InfluxDB connection:
|
|
||||||
|
|
||||||
1. Ensure [Flux is enabled](/influxdb/v1/flux/installation/) in InfluxDB.
|
1. Ensure [Flux is enabled](/influxdb/v1/flux/installation/) in your InfluxDB configuration file.
|
||||||
|
|
||||||
2. Under **HTTP**, enter the following:
|
2. Configure the database settings:
|
||||||
|
|
||||||
- **URL**: Your **InfluxDB URL**.
|
- **Organization**: Provide an arbitrary value (InfluxDB 1.x does not use organizations)
|
||||||
|
- **Default Bucket**: Provide a default database and retention policy
|
||||||
|
- **Token**: If [InfluxDB authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/) provide your InfluxDB username and password
|
||||||
|
|
||||||
```sh
|
{{< img-hd src="/img/influxdb3/OSS-v1-grafana-product-dropdown-flux.png" alt="Flux configuration for InfluxDB OSS 1.x" />}}
|
||||||
http://localhost:8086
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Under **InfluxDB Details**, enter the following:
|
Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns the result of the test.
|
||||||
|
|
||||||
- **Organization**: Provide an arbitrary value.
|
|
||||||
- **Token**: If [InfluxDB authentication is enabled](/influxdb/v1/administration/authentication_and_authorization/),
|
|
||||||
provide your InfluxDB username and password using the following syntax:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Syntax
|
|
||||||
username:password
|
|
||||||
|
|
||||||
# Example
|
|
||||||
johndoe:mY5uP3rS3crE7pA5Sw0Rd
|
|
||||||
```
|
|
||||||
|
|
||||||
If authentication is not enabled, leave blank.
|
|
||||||
|
|
||||||
- **Default Bucket**: Provide a default database and retention policy combination
|
|
||||||
using the following syntax:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Syntax
|
|
||||||
database-name/retention-policy-name
|
|
||||||
|
|
||||||
# Examples
|
|
||||||
example-db/example-rp
|
|
||||||
telegraf/autogen
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Min time interval**: [Grafana minimum time interval](https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#min-time-interval).
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb/v1-tools-grafana-flux.png" />}}
|
|
||||||
|
|
||||||
3. Click **Save & Test**. Grafana attempts to connect to InfluxDB and returns
|
|
||||||
the result of the test.
|
|
||||||
{{% /tab-content %}}
|
|
||||||
<!------------------------------ END FLUX CONTENT ----------------------------->
|
<!------------------------------ END FLUX CONTENT ----------------------------->
|
||||||
|
{{% /tab-content %}}
|
||||||
{{< /tabs-wrapper >}}
|
{{< /tabs-wrapper >}}
|
||||||
|
|
||||||
|
## Query and visualize data
|
||||||
|
|
||||||
|
With your InfluxDB connection configured, use Grafana to query and visualize time series data.
|
||||||
|
|
||||||
|
For more information, see:
|
||||||
|
- [Grafana documentation](https://grafana.com/docs/grafana/latest/)
|
||||||
|
- [Get started with Flux](/flux/v0/get-started/)
|
||||||
|
|
@ -17,9 +17,7 @@ alt_links:
|
||||||
cloud-serverless: /influxdb3/cloud-serverless/process-data/visualize/grafana/
|
cloud-serverless: /influxdb3/cloud-serverless/process-data/visualize/grafana/
|
||||||
cloud-dedicated: /influxdb3/cloud-dedicated/process-data/visualize/grafana/
|
cloud-dedicated: /influxdb3/cloud-dedicated/process-data/visualize/grafana/
|
||||||
clustered: /influxdb3/clustered/process-data/visualize/grafana/
|
clustered: /influxdb3/clustered/process-data/visualize/grafana/
|
||||||
source: /shared/influxdb3-visualize/grafana.md
|
source: /content/shared/v3-process-data/visualize/grafana.md
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!-- SOURCE: /content/shared/v3-process-data/visualize/grafana.md -->
|
||||||
The content of this page is at content/shared/influxdb3-visualize/grafana.md
|
|
||||||
-->
|
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,7 @@ alt_links:
|
||||||
cloud-serverless: /influxdb3/cloud-serverless/process-data/visualize/grafana/
|
cloud-serverless: /influxdb3/cloud-serverless/process-data/visualize/grafana/
|
||||||
cloud-dedicated: /influxdb3/cloud-dedicated/process-data/visualize/grafana/
|
cloud-dedicated: /influxdb3/cloud-dedicated/process-data/visualize/grafana/
|
||||||
clustered: /influxdb3/clustered/process-data/visualize/grafana/
|
clustered: /influxdb3/clustered/process-data/visualize/grafana/
|
||||||
source: /shared/influxdb3-visualize/grafana.md
|
source: /content/shared/v3-process-data/visualize/grafana.md
|
||||||
---
|
---
|
||||||
|
|
||||||
<!--
|
<!-- SOURCE: /content/shared/v3-process-data/visualize/grafana.md -->
|
||||||
The content of this page is at content/shared/influxdb3-visualize/grafana.md
|
|
||||||
-->
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,14 @@ Using InfluxDB 3's IOx-specific Flight RPC protocol, clients send a single `DoGe
|
||||||
**Flight SQL clients** use the [Flight SQL protocol](https://arrow.apache.org/docs/format/FlightSql.html) for querying an SQL database server.
|
**Flight SQL clients** use the [Flight SQL protocol](https://arrow.apache.org/docs/format/FlightSql.html) for querying an SQL database server.
|
||||||
They can use SQL to query data stored in an {{% product-name %}} database, but they can't use InfuxQL.
|
They can use SQL to query data stored in an {{% product-name %}} database, but they can't use InfuxQL.
|
||||||
|
|
||||||
|
> [!Important]
|
||||||
|
> #### Flight SQL requires HTTP/2
|
||||||
|
>
|
||||||
|
> Flight SQL uses gRPC, which requires **HTTP/2**.
|
||||||
|
> If you connect to {{% product-name %}} through a proxy (such as HAProxy, nginx, or a load balancer),
|
||||||
|
> verify that your proxy is configured to support HTTP/2.
|
||||||
|
> Without HTTP/2 support, Flight SQL connections will fail.
|
||||||
|
|
||||||
Clients are maintained by Apache Arrow projects or third-parties.
|
Clients are maintained by Apache Arrow projects or third-parties.
|
||||||
For specifics about a Flight client, see the client's GitHub repository.
|
For specifics about a Flight client, see the client's GitHub repository.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,349 +5,169 @@ to visualize data from your **InfluxDB {{< current-version >}}** instance.
|
||||||
The instructions in this guide require **Grafana Cloud** or **Grafana 10.3+**.
|
The instructions in this guide require **Grafana Cloud** or **Grafana 10.3+**.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
1. {{% show-in "cloud,cloud-serverless" %}}[Log into InfluxDB Cloud](https://cloud2.influxdata.com).{{% /show-in %}}
|
- [Install Grafana](#install-grafana)
|
||||||
{{% show-in "v2" %}}[Start InfluxDB](/influxdb/version/install/#configure-and-start-influxdb).{{% /show-in %}}
|
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
||||||
|
- [Query and visualize data](#query-and-visualize-data)
|
||||||
|
|
||||||
|
## Install Grafana
|
||||||
|
|
||||||
|
1. [Start InfluxDB OSS 2.x](/influxdb/v2/install/#configure-and-start-influxdb).
|
||||||
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
2. [Sign up for Grafana Cloud](https://grafana.com/products/cloud/) or
|
||||||
[download and install Grafana](https://grafana.com/grafana/download).
|
[download and install Grafana](https://grafana.com/grafana/download).
|
||||||
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
3. Visit your **Grafana Cloud user interface** (UI) or, if running Grafana locally,
|
||||||
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
[start Grafana](https://grafana.com/docs/grafana/latest/installation/) and visit
|
||||||
<http://localhost:3000> in your browser.
|
<http://localhost:3000> in your browser.
|
||||||
4. In the left navigation of the Grafana UI, open the **Connections** section
|
|
||||||
and select **Add new connection**.
|
|
||||||
5. Select **InfluxDB** from the list of available data sources and click
|
|
||||||
**Add new data source**.
|
|
||||||
6. On the **Data Source configuration page**, enter a **name** for your InfluxDB data source.
|
|
||||||
7. In the **Query Language** drop-down menu, select one of the query languages
|
|
||||||
supported by InfluxDB {{< current-version >}} (Flux or InfluxQL):
|
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
SQL is only supported in InfluxDB 3.
|
SQL is only supported in InfluxDB 3.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
## Create an InfluxDB data source
|
||||||
|
|
||||||
|
1. In your Grafana interface, click **Connections** in the left sidebar
|
||||||
|
2. Click **Data sources**
|
||||||
|
3. Click **Add new connection**
|
||||||
|
4. Locate and click the **InfluxDB** card
|
||||||
|
|
||||||
|
The InfluxDB configuration page displays with four numbered sections in the left sidebar.
|
||||||
|
|
||||||
|
5. **Name**: Enter a descriptive name for your data source
|
||||||
|
6. **URL**: Enter your [InfluxDB URL](/influxdb/v2/reference/urls/): http://localhost:8086
|
||||||
|
|
||||||
|
7. **Product**: From the dropdown, select {{% show-in "v2" %}}**InfluxDB OSS 2.x**{{% /show-in %}}{{% show-in "cloud" %}}**InfluxDB Cloud (TSM)**{{% /show-in %}}
|
||||||
|
8. **Query Language**: Select **Flux** or **InfluxQL**
|
||||||
|
|
||||||
|
After selecting your query language, section 2 (Database settings) displays fields specific to your selection.
|
||||||
|
|
||||||
|
### Configure database settings
|
||||||
|
|
||||||
|
The fields in this section change based on your query language selection.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
[Flux](#)
|
[Flux](#)
|
||||||
[InfluxQL](#)
|
[InfluxQL](#)
|
||||||
{{% /tabs %}}
|
{{% /tabs %}}
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!--------------------------------- BEGIN FLUX --------------------------------->
|
||||||
|
|
||||||
## Configure Grafana to use Flux
|
## Configure Grafana to use Flux
|
||||||
|
|
||||||
With **Flux** selected as the query language in your InfluxDB data source,
|
When you select **Flux** as the query language, configure the following:
|
||||||
configure your InfluxDB connection:
|
|
||||||
|
|
||||||
1. Under **HTTP**, enter the following:
|
- **Organization**: Your InfluxDB [organization name or ID](/influxdb/v2/admin/organizations/view-orgs/)
|
||||||
|
- **Default Bucket**: The default [bucket](/influxdb/v2/admin/buckets/) to use in Flux queries
|
||||||
|
- **Token**: Your InfluxDB [API token](/influxdb/v2/admin/tokens/)
|
||||||
|
|
||||||
- **URL**: Your
|
{{% show-in "v2" %}}{{< img-hd src="/img/influxdb/OSS-v2-grafana-product-dropdown-flux.png" alt="Flux configuration for InfluxDB OSS 2.x" />}}{{% /show-in %}}
|
||||||
{{% show-in "v2" %}}[InfluxDB URL](/influxdb/version/reference/urls/).{{% /show-in %}}
|
{{% show-in "cloud" %}}{{< img-hd src="/img/influxdb/cloud-tools-grafana-flux.png" alt="Flux configuration for InfluxDB Cloud (TSM)" />}}{{% /show-in %}}
|
||||||
{{% show-in "cloud,cloud-serverless" %}}[InfluxDB Cloud region URL](/influxdb/version/reference/regions/).{{% /show-in %}}
|
|
||||||
|
|
||||||
```sh
|
Click **Save & Test**. Grafana attempts to connect to {{% show-in "v2" %}}InfluxDB OSS 2.x{{% /show-in %}}{{% show-in "cloud" %}}InfluxDB Cloud{{% /show-in %}} and returns the results of the test.
|
||||||
http://localhost:8086/
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Under **InfluxDB Details**, enter the following:
|
|
||||||
|
|
||||||
- **Organization**: Your InfluxDB [organization name **or** ID](/influxdb/version/admin/organizations/view-orgs/).
|
|
||||||
- **Token**: Your InfluxDB [API token](/influxdb/version/admin/tokens/).
|
|
||||||
- **Default Bucket**: The default [bucket](/influxdb/version/admin/buckets/) to
|
|
||||||
use in Flux queries.
|
|
||||||
- **Min time interval**: The [Grafana minimum time interval](https://grafana.com/docs/grafana/latest/features/datasources/influxdb/#min-time-interval).
|
|
||||||
Default is `10s`
|
|
||||||
- **Max series**: The maximum number of series or tables Grafana will process.
|
|
||||||
Default is `1000`.
|
|
||||||
|
|
||||||
3. Click **Save & Test**. Grafana attempts to connect to the InfluxDB {{< current-version >}}
|
|
||||||
datasource and returns the results of the test.
|
|
||||||
|
|
||||||
{{% show-in "cloud,cloud-serverless" %}}
|
|
||||||
{{< img-hd src="/img/influxdb/cloud-tools-grafana-flux.png" alt="Use Grafana with InfluxDB Cloud and Flux" />}}
|
|
||||||
{{% /show-in %}}
|
|
||||||
|
|
||||||
{{% show-in "v2" %}}
|
|
||||||
{{< img-hd src="/img/influxdb/version-tools-grafana-flux.png" alt="Use Grafana with InfluxDB and Flux" />}}
|
|
||||||
{{% /show-in %}}
|
|
||||||
|
|
||||||
|
<!---------------------------------- END FLUX ---------------------------------->
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
<!----------------------------- END FLUX CONTENT ----------------------------->
|
|
||||||
<!-------------------------- BEGIN INFLUXQL CONTENT -------------------------->
|
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
|
<!------------------------------- BEGIN INFLUXQL ------------------------------>
|
||||||
|
|
||||||
## Configure Grafana to use InfluxQL
|
## Configure Grafana to use InfluxQL
|
||||||
|
|
||||||
<!---------------------------------------------------------------------------->
|
> [!Important]
|
||||||
<!------------------------- BEGIN OSS InfluxQL setup ------------------------->
|
> #### DBRP mapping required
|
||||||
<!---------------------------------------------------------------------------->
|
>
|
||||||
{{% show-in "v2" %}}
|
> To query InfluxDB OSS 2.x with InfluxQL, you must first create Database and Retention Policy (DBRP) mappings.
|
||||||
|
> The configuration form displays a warning if DBRP mapping is required.
|
||||||
|
|
||||||
To query InfluxDB {{< current-version >}} with InfluxQL, find your use case below,
|
When you select **InfluxQL** as the query language, you can authenticate using either tokens or username/password credentials.
|
||||||
and then complete the instructions to configure Grafana:
|
|
||||||
|
|
||||||
- [Installed a new InfluxDB {{< current-version >}} instance](#installed-a-new-influxdb-instance)
|
### Token authentication (recommended)
|
||||||
- [Upgraded from InfluxDB 1.x to {{< current-version >}} (following the official upgrade)](#upgraded-from-influxdb-1x-to-2x)
|
|
||||||
- [Manually migrated from InfluxDB 1.x to {{< current-version >}}](#manually-migrated-from-influxdb-1x-to-2x)
|
|
||||||
|
|
||||||
### Installed a new InfluxDB instance
|
Configure the following fields:
|
||||||
|
|
||||||
To configure Grafana to use InfluxQL with a new install of InfluxDB {{< current-version >}}, do the following:
|
- **Database**: The database name [mapped to your InfluxDB bucket](#create-dbrp-mappings)
|
||||||
|
- **User**: Enter any string (this field is required by the form)
|
||||||
|
- **Password**: Your InfluxDB [API token](/influxdb/v2/admin/tokens/)
|
||||||
|
|
||||||
1. [Authenticate with InfluxDB {{< current-version >}} tokens](/influxdb/version/admin/tokens/).
|
### Username and password authentication
|
||||||
2. [Manually create DBRP mappings](#view-and-create-influxdb-dbrp-mappings).
|
|
||||||
|
|
||||||
### Upgraded from InfluxDB 1.x to 2.x
|
Configure the following fields:
|
||||||
|
|
||||||
To configure Grafana to use InfluxQL when you've upgraded from InfluxDB 1.x to
|
- **Database**: The database name [mapped to your InfluxDB bucket](#create-dbrp-mappings)
|
||||||
InfluxDB {{< current-version >}} (following an [official upgrade guide](/influxdb/version/upgrade/v1-to-v2/)):
|
- **User**: Your [v1 authorization username](#create-v1-authorizations)
|
||||||
|
- **Password**: Your [v1 authorization password](#create-v1-authorizations)
|
||||||
|
|
||||||
1. Authenticate using the _non-admin_ [v1 compatible authentication credentials](#view-and-create-influxdb-v1-authorizations)
|
{{% show-in "v2" %}}{{< img-hd src="/img/influxdb/OSS-v2-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for InfluxDB OSS 2.x with DBRP warning" />}}{{% /show-in %}}
|
||||||
created during the upgrade process.
|
{{% show-in "cloud" %}}{{< img-hd src="/img/influxdb/influxdb-v2-cloud-influxql.png" alt="InfluxQL configuration for InfluxDB Cloud (TSM) with v1 auth" />}}{{% /show-in %}}
|
||||||
2. Use the DBRP mappings InfluxDB automatically created in the upgrade process (no action necessary).
|
|
||||||
|
|
||||||
### Manually migrated from InfluxDB 1.x to 2.x
|
Click **Save & Test**. Grafana attempts to connect to {{% show-in "v2" %}}InfluxDB OSS 2.x{{% /show-in %}}{{% show-in "cloud" %}}InfluxDB Cloud{{% /show-in %}} and returns the results of the test.
|
||||||
|
|
||||||
To configure Grafana to use InfluxQL when you've manually migrated from InfluxDB
|
### Create DBRP mappings
|
||||||
1.x to InfluxDB {{< current-version >}}, do the following:
|
|
||||||
|
|
||||||
1. If your InfluxDB 1.x instance required authentication,
|
When using InfluxQL to query InfluxDB, the query must specify a database and retention policy.
|
||||||
[create v1 compatible authentication credentials](#view-and-create-influxdb-v1-authorizations)
|
InfluxDB DBRP mappings associate database and retention policy combinations with InfluxDB OSS 2.x buckets.
|
||||||
to match your previous 1.x username and password.
|
|
||||||
Otherwise, use [InfluxDB v2 token authentication](/influxdb/version/admin/tokens/).
|
|
||||||
2. [Manually create DBRP mappings](#view-and-create-influxdb-dbrp-mappings).
|
|
||||||
|
|
||||||
{{< expand-wrapper >}}
|
#### View existing DBRP mappings
|
||||||
{{% expand "View and create InfluxDB v1 authorizations" %}}
|
|
||||||
|
|
||||||
InfluxDB {{< current-version >}} provides a 1.x compatible authentication API that lets you
|
Use the [`influx v1 dbrp list`](/influxdb/v2/reference/cli/influx/v1/dbrp/list/) command:
|
||||||
authenticate with a username and password like InfluxDB 1.x
|
```sh
|
||||||
_(separate from the credentials used to log into the InfluxDB user interface)_.
|
influx v1 dbrp list
|
||||||
|
```
|
||||||
|
|
||||||
|
### Create a DBRP mappings
|
||||||
|
|
||||||
|
Use the influx v1 dbrp create command:
|
||||||
|
```sh
|
||||||
|
influx v1 dbrp create \
|
||||||
|
--db example-db \
|
||||||
|
--rp example-rp \
|
||||||
|
--bucket-id 00xX00o0X001 \
|
||||||
|
--default
|
||||||
|
```
|
||||||
|
|
||||||
|
Provide:
|
||||||
|
|
||||||
|
- `--db:` Database name
|
||||||
|
- `--rp:` Retention policy name (not retention period)
|
||||||
|
- `--bucket-id:` Bucket ID
|
||||||
|
- `--default:` (Optional) Make this the default retention policy for the database
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
**Repeat for each DBRP combination**
|
||||||
|
Each unique database and retention policy combination used by Grafana must be mapped to an InfluxDB OSS 2.x bucket.
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
|
For more information, see [Database and retention policy mapping](/influxdb/v2/api-guide/influxdb-1x/dbrp/).
|
||||||
|
|
||||||
|
### Create v1 authorizations
|
||||||
|
|
||||||
|
InfluxDB OSS 2.x provides a v1-compatible authentication API for username/password authentication.
|
||||||
|
|
||||||
#### View existing v1 authorizations
|
#### View existing v1 authorizations
|
||||||
|
|
||||||
Use the [`influx v1 auth list`](/influxdb/version/reference/cli/influx/v1/auth/list/)
|
Use the [`influx v1 auth list`](/influxdb/v2/reference/cli/influx/v1/auth/list/) command:
|
||||||
to list existing InfluxDB v1 compatible authorizations.
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
influx v1 auth list
|
influx v1 auth list
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Create a v1 authorization
|
#### Create a v1 authorization
|
||||||
|
|
||||||
Use the [`influx v1 auth create` command](/influxdb/version/reference/cli/influx/v1/auth/create/)
|
Use the [`influx v1 auth create`](/influxdb/v2/reference/cli/influx/v1/auth/create/) command:
|
||||||
to grant read/write permissions to specific buckets. Provide the following:
|
|
||||||
|
|
||||||
- [bucket IDs](/influxdb/version/admin/buckets/view-buckets/) to grant read
|
|
||||||
or write permissions to
|
|
||||||
- new username
|
|
||||||
- new password _(when prompted)_
|
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
```sh
|
```sh
|
||||||
influx v1 auth create \
|
influx v1 auth create \
|
||||||
--read-bucket 00xX00o0X001 \
|
--read-bucket 00xX00o0X001 \
|
||||||
--write-bucket 00xX00o0X001 \
|
--write-bucket 00xX00o0X001 \
|
||||||
--username example-user
|
--username example-user
|
||||||
```
|
```
|
||||||
{{% /expand %}}
|
|
||||||
{{< expand "View and create InfluxDB DBRP mappings" >}}
|
|
||||||
|
|
||||||
When using InfluxQL to query InfluxDB, the query must specify a database and a retention policy.
|
Provide:
|
||||||
InfluxDB DBRP mappings associate database and retention policy combinations with
|
|
||||||
InfluxDB {{< current-version >}} [buckets](/influxdb/version/reference/glossary/#bucket).
|
|
||||||
|
|
||||||
DBRP mappings do not affect the retention period of the target bucket.
|
- `--read-bucket`: Bucket ID to grant read permissions
|
||||||
These mappings allow queries following InfluxDB 1.x conventions to successfully
|
- `--write-bucket`: Bucket ID to grant write permissions
|
||||||
query InfluxDB {{< current-version >}} buckets.
|
- `--username`: New username
|
||||||
|
|
||||||
#### View existing DBRP mappings
|
You'll be prompted to enter a password.
|
||||||
|
<!-------------------------------- END INFLUXQL ------------------------------->
|
||||||
Use the [`influx v1 dbrp list`](/influxdb/version/reference/cli/influx/v1/dbrp/list/)
|
|
||||||
to list existing DBRP mappings.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
influx v1 dbrp list
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Create a DBRP mapping
|
|
||||||
|
|
||||||
Use the [`influx v1 dbrp create` command](/influxdb/version/reference/cli/influx/v1/dbrp/create/)
|
|
||||||
command to create a DBRP mapping.
|
|
||||||
Provide the following:
|
|
||||||
|
|
||||||
- database name
|
|
||||||
- retention policy name _(not retention period)_
|
|
||||||
- [bucket ID](/influxdb/version/admin/buckets/view-buckets/)
|
|
||||||
- _(optional)_ `--default` flag if you want the retention policy to be the default retention
|
|
||||||
policy for the specified database
|
|
||||||
|
|
||||||
```sh
|
|
||||||
influx v1 dbrp create \
|
|
||||||
--db example-db \
|
|
||||||
--rp example-rp \
|
|
||||||
--bucket-id 00xX00o0X001 \
|
|
||||||
--default
|
|
||||||
```
|
|
||||||
|
|
||||||
{{% note %}}
|
|
||||||
#### Repeat for each DBRP combination
|
|
||||||
|
|
||||||
Each unique database and retention policy combination used by Grafana must be
|
|
||||||
mapped to an InfluxDB {{< current-version >}} bucket.
|
|
||||||
If you have multiple retention policies for a single bucket, set one of the the
|
|
||||||
retention polices as the default using the `--default` flag.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
_For more information about DBRP mapping, see
|
|
||||||
[Database and retention policy mapping](/influxdb/version/reference/api/influxdb-1x/dbrp/)._
|
|
||||||
|
|
||||||
{{< /expand >}}
|
|
||||||
{{< /expand-wrapper >}}
|
|
||||||
|
|
||||||
{{% /show-in %}}
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
<!-------------------------- END OSS InfluxQL setup -------------------------->
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
<!------------------------ BEGIN Cloud InfluxQL setup ------------------------>
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
{{% show-in "cloud,cloud-serverless" %}}
|
|
||||||
|
|
||||||
To query InfluxDB Cloud from Grafana using InfluxQL:
|
|
||||||
|
|
||||||
1. [Download and set up the `influx` CLI](#download-and-set-up-the-influx-cli)
|
|
||||||
2. [Create an InfluxDB DBRP mapping](#create-an-influxdb-dbrp-mapping)
|
|
||||||
3. [Configure your InfluxDB connection](#configure-your-influxdb-connection)
|
|
||||||
|
|
||||||
### Download and set up the influx CLI
|
|
||||||
|
|
||||||
1. [Download the latest version of the `influx` CLI](/influxdb/cloud/sign-up/#optional-download-install-and-use-the-influx-cli)
|
|
||||||
appropriate for your local operating system.
|
|
||||||
2. Create a CLI configuration that provides the required InfluxDB Cloud **host**,
|
|
||||||
**organization**, and **API token** to all CLI commands.
|
|
||||||
Use the [`influx config create` command](/influxdb/cloud/reference/cli/influx/config/create/)
|
|
||||||
and provide the following:
|
|
||||||
|
|
||||||
- [InfluxDB Cloud URL](/influxdb/cloud/reference/regions/)
|
|
||||||
- [organization name](/influxdb/cloud/admin/organizations/) _(by default, your email address)_
|
|
||||||
- [API token](/influxdb/cloud/admin/tokens/)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
influx config create \
|
|
||||||
--config-name example-config-name \
|
|
||||||
--host-url https://{{< influxdb/host >}} \
|
|
||||||
--org example-org \
|
|
||||||
--token My5uP3rSeCr37t0k3n
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information about `influx` CLI configurations,
|
|
||||||
see [`influx config`](/influxdb/cloud/reference/cli/influx/config/).
|
|
||||||
|
|
||||||
### Create an InfluxDB DBRP mapping
|
|
||||||
|
|
||||||
When using InfluxQL to query InfluxDB Cloud, the query must specify a database and a retention policy.
|
|
||||||
Use the [`influx v1 dbrp create` command](/influxdb/cloud/reference/cli/influx/v1/dbrp/create/)
|
|
||||||
command to create a database/retention policy (DBRP) mapping that associates a database
|
|
||||||
and retention policy combination with an InfluxDB Cloud [bucket](/influxdb/cloud/reference/glossary/#bucket).
|
|
||||||
|
|
||||||
DBRP mappings do not affect the retention period of the target bucket.
|
|
||||||
These mappings allow queries following InfluxDB 1.x conventions to successfully
|
|
||||||
query InfluxDB Cloud buckets.
|
|
||||||
|
|
||||||
{{% note %}}
|
|
||||||
##### Automatically create DBRP mappings on write
|
|
||||||
|
|
||||||
When using the InfluxDB 1.x compatibility API to write data to InfluxDB Cloud,
|
|
||||||
InfluxDB Cloud automatically creates DBRP mappings for buckets whose names match the
|
|
||||||
`db/rp` naming pattern of the database and retention policy specified in the write request.
|
|
||||||
For more information, see [Database and retention policy mapping – Writing data](/influxdb/cloud/reference/api/influxdb-1x/dbrp/#when-writing-data).
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
Provide the following:
|
|
||||||
|
|
||||||
- database name
|
|
||||||
- [retention policy](/influxdb/v1/concepts/glossary/#retention-policy-rp) name _(not retention period)_
|
|
||||||
- [bucket ID](/influxdb/cloud/admin/buckets/view-buckets/)
|
|
||||||
- _(optional)_ `--default` flag if you want the retention policy to be the default retention
|
|
||||||
policy for the specified database
|
|
||||||
|
|
||||||
```sh
|
|
||||||
influx v1 dbrp create \
|
|
||||||
--db example-db \
|
|
||||||
--rp example-rp \
|
|
||||||
--bucket-id 00xX00o0X001 \
|
|
||||||
--default
|
|
||||||
```
|
|
||||||
|
|
||||||
{{% note %}}
|
|
||||||
#### Repeat for each DBRP combination
|
|
||||||
|
|
||||||
Each unique database and retention policy combination used by Grafana must be
|
|
||||||
mapped to an InfluxDB {{< current-version >}} bucket.
|
|
||||||
If you have multiple retention policies for a single bucket, set one of the the
|
|
||||||
retention polices as the default using the `--default` flag.
|
|
||||||
{{% /note %}}
|
|
||||||
|
|
||||||
_For more information about DBRP mapping, see
|
|
||||||
[Database and retention policy mapping](/influxdb/cloud/reference/api/influxdb-1x/dbrp/)._
|
|
||||||
|
|
||||||
{{% /show-in %}}
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
<!------------------------- END Cloud InfluxQL setup ------------------------->
|
|
||||||
<!---------------------------------------------------------------------------->
|
|
||||||
|
|
||||||
|
|
||||||
### Configure your InfluxDB connection
|
|
||||||
|
|
||||||
With **InfluxQL** selected as the query language in your InfluxDB data source settings:
|
|
||||||
|
|
||||||
1. Under **HTTP**, enter the following:
|
|
||||||
|
|
||||||
- **URL**: Your [InfluxDB URL](/influxdb/version/reference/urls/).
|
|
||||||
|
|
||||||
```sh
|
|
||||||
http://localhost:8086/
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Configure InfluxDB authentication:
|
|
||||||
|
|
||||||
- ##### Token authentication
|
|
||||||
|
|
||||||
- Under **Custom HTTP Headers**, select **{{< icon "plus" >}}Add Header**. Provide your InfluxDB API token:
|
|
||||||
|
|
||||||
- **Header**: Enter `Authorization`
|
|
||||||
- **Value**: Use the `Token` schema and provide your [InfluxDB API token](/influxdb/version/admin/tokens/).
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
Token y0uR5uP3rSecr3tT0k3n
|
|
||||||
```
|
|
||||||
|
|
||||||
- Under **InfluxDB Details**, do the following:
|
|
||||||
|
|
||||||
- **Database**: Enter the database name [mapped to your InfluxDB {{< current-version >}} bucket](#view-and-create-influxdb-dbrp-mappings)
|
|
||||||
- **HTTP Method**: Select **GET**
|
|
||||||
|
|
||||||
- ##### Authenticate with username and password
|
|
||||||
|
|
||||||
Under **InfluxDB Details**, do the following:
|
|
||||||
|
|
||||||
- **Database**: Enter the database name [mapped to your InfluxDB {{< current-version >}} bucket](#view-and-create-influxdb-dbrp-mappings)
|
|
||||||
- **User**: Enter the username associated with your [InfluxDB 1.x compatibility authorization](#view-and-create-influxdb-v1-authorizations)
|
|
||||||
- **Password**: Enter the password associated with your [InfluxDB 1.x compatibility authorization](#view-and-create-influxdb-dbrp-mappings)
|
|
||||||
- **HTTP Method**: Select **GET**
|
|
||||||
|
|
||||||
3. Click **Save & Test**. Grafana attempts to connect to the InfluxDB {{< current-version >}} data source
|
|
||||||
and returns the results of the test.
|
|
||||||
|
|
||||||
{{% show-in "cloud,cloud-serverless" %}}
|
|
||||||
{{< img-hd src="/img/influxdb/cloud-tools-grafana-influxql.png" alt="Use Grafana with InfluxDB Cloud and Flux" />}}
|
|
||||||
{{% /show-in %}}
|
|
||||||
|
|
||||||
{{< show-in "v2" >}}
|
|
||||||
{{< img-hd src="/img/influxdb/version-tools-grafana-influxql.png" alt="Use Grafana with InfluxDB and Flux" />}}
|
|
||||||
{{< /show-in >}}
|
|
||||||
|
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
<!--------------------------- END INFLUXQL CONTENT --------------------------->
|
|
||||||
{{< /tabs-wrapper >}}
|
{{< /tabs-wrapper >}}
|
||||||
|
|
||||||
## Query and visualize data
|
## Query and visualize data
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ Use [Grafana](https://grafana.com/) to query and visualize data from
|
||||||
|
|
||||||
- [Install Grafana or login to Grafana Cloud](#install-grafana-or-login-to-grafana-cloud)
|
- [Install Grafana or login to Grafana Cloud](#install-grafana-or-login-to-grafana-cloud)
|
||||||
- [InfluxDB data source](#influxdb-data-source)
|
- [InfluxDB data source](#influxdb-data-source)
|
||||||
|
- [Before you begin](#before-you-begin)
|
||||||
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
||||||
- [Query InfluxDB with Grafana](#query-influxdb-with-grafana)
|
- [Query InfluxDB with Grafana](#query-influxdb-with-grafana)
|
||||||
- [Build visualizations with Grafana](#build-visualizations-with-grafana)
|
- [Build visualizations with Grafana](#build-visualizations-with-grafana)
|
||||||
|
|
@ -37,15 +38,33 @@ both SQL and InfluxQL.
|
||||||
> The instructions below are for **Grafana 10.3+** which introduced the newest
|
> The instructions below are for **Grafana 10.3+** which introduced the newest
|
||||||
> version of the InfluxDB core plugin.
|
> version of the InfluxDB core plugin.
|
||||||
> The updated plugin includes **SQL support** for InfluxDB 3-based products such
|
> The updated plugin includes **SQL support** for InfluxDB 3-based products such
|
||||||
> as {{< product-name >}}.
|
> as {{< product-name >}}, and the interface dynamically adapts based on your product and query language selections.
|
||||||
|
|
||||||
|
|
||||||
|
## Before you begin
|
||||||
|
|
||||||
|
**Prerequisites:**
|
||||||
|
- Grafana 10.3 or later
|
||||||
|
- Administrator role in Grafana
|
||||||
|
- {{% product-name %}} instance and [database token](/influxdb3/version/admin/tokens/#database-tokens)
|
||||||
|
|
||||||
## Create an InfluxDB data source
|
## Create an InfluxDB data source
|
||||||
|
|
||||||
1. In your Grafana user interface (UI), navigate to **Data Sources**.
|
1. In your Grafana interface, click **Connections** in the left sidebar
|
||||||
2. Click **Add new data source**.
|
2. Click **Data sources**
|
||||||
3. Search for and select the **InfluxDB** plugin.
|
3. Click **Add new data source**
|
||||||
4. Provide a name for your data source.
|
4. Under **Time series databases**, select **InfluxDB**
|
||||||
5. Under **Query Language**, select either **SQL** or **InfluxQL**:
|
|
||||||
|
The configuration form displays with four numbered sections. Section 2 (Database settings) displays different fields based on your query language selection.
|
||||||
|
|
||||||
|
5. **Name**: Enter a descriptive name for your data source
|
||||||
|
6. **URL**: Enter your {{% product-name %}} cluster URL: `https://{{< influxdb/host >}}`
|
||||||
|
7. **Product**: From the dropdown, select **InfluxDB Enterprise 3.x**
|
||||||
|
8. **Query Language**: Select **SQL** or **InfluxQL**
|
||||||
|
|
||||||
|
### Configure database settings
|
||||||
|
|
||||||
|
The fields in this section change based on your query language selection.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
|
|
@ -55,59 +74,26 @@ both SQL and InfluxQL.
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
<!--------------------------------- BEGIN SQL --------------------------------->
|
<!--------------------------------- BEGIN SQL --------------------------------->
|
||||||
|
|
||||||
When creating an InfluxDB data source that uses SQL to query data:
|
When you select **SQL** as the query language, configure the following:
|
||||||
|
|
||||||
1. Under **HTTP**:
|
- **Database**: Your [database](/influxdb3/version/admin/databases/) name
|
||||||
|
- **Token**: A [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the database
|
||||||
|
|
||||||
- **URL**: Provide your {{% product-name %}} URL:
|
{{< img-hd src="/img/influxdb3/enterprise-v3-grafana-product-dropdown-sql.png" alt="Grafana InfluxDB data source for InfluxDB 3 that uses SQL" />}}
|
||||||
|
|
||||||
```
|
|
||||||
http://{{< influxdb/host >}}
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!Note]
|
|
||||||
> If you are _not_ using HTTPS, enable the **Insecure Connection** option
|
|
||||||
> under **InfluxDB Details**.
|
|
||||||
|
|
||||||
2. Under **InfluxDB Details**:
|
|
||||||
|
|
||||||
- **Database**: Provide a default database name to query.
|
|
||||||
- **Token**: Provide an arbitrary, non-empty string.
|
|
||||||
- **Insecure Connection**: If _not_ using HTTPS, enable this option.
|
|
||||||
|
|
||||||
3. Click **Save & test**.
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb3/influxdb3-grafana-sql.png" alt="Grafana InfluxDB data source for InfluxDB 3 that uses SQL" />}}
|
|
||||||
|
|
||||||
<!---------------------------------- END SQL ---------------------------------->
|
<!---------------------------------- END SQL ---------------------------------->
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
<!------------------------------- BEGIN INFLUXQL ------------------------------>
|
<!------------------------------- BEGIN INFLUXQL ------------------------------>
|
||||||
|
|
||||||
When creating an InfluxDB data source that uses InfluxQL to query data:
|
When you select **InfluxQL** as the query language, configure the following:
|
||||||
|
|
||||||
1. Under **HTTP**:
|
- **Database**: Your [database](/influxdb3/version/admin/databases/) name
|
||||||
|
- **User**: Enter a username.
|
||||||
|
- **Password**: A [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the database
|
||||||
|
- **HTTP Method**: Select **POST** (recommended) or **GET**
|
||||||
|
|
||||||
- **URL**: Provide your {{% product-name %}} URL:
|
{{< img-hd src="/img/influxdb3/enterprise-v3-grafana-product-dropdown-influxql.png" alt="Grafana InfluxDB data source for InfluxDB 3 that uses InfluxQL" />}}
|
||||||
|
|
||||||
```
|
|
||||||
https://{{< influxdb/host >}}
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Under **InfluxDB Details**:
|
|
||||||
|
|
||||||
- **Database**: Provide a default database name to query.
|
|
||||||
- **User**: Provide an arbitrary string.
|
|
||||||
_This credential is ignored when querying {{% product-name %}}, but it cannot be empty._
|
|
||||||
- **Password**: Provide an arbitrary string.
|
|
||||||
- **HTTP Method**: Choose one of the available HTTP request methods to use when querying data:
|
|
||||||
|
|
||||||
- **POST** ({{< req text="Recommended" >}})
|
|
||||||
- **GET**
|
|
||||||
|
|
||||||
3. Click **Save & test**.
|
|
||||||
|
|
||||||
{{< img-hd src="/img/influxdb3/influxdb3-grafana-influxql.png" alt="Grafana InfluxDB data source for InfluxDB 3 that uses InfluxQL" />}}
|
|
||||||
|
|
||||||
<!-------------------------------- END INFLUXQL ------------------------------->
|
<!-------------------------------- END INFLUXQL ------------------------------->
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
Use [Grafana](https://grafana.com/) to query and visualize data stored in
|
Use [Grafana](https://grafana.com/) or [Grafana Cloud](https://grafana.com/products/cloud/)
|
||||||
{{% product-name %}}.
|
to query and visualize data from {{% product-name %}}.
|
||||||
|
|
||||||
> [Grafana] enables you to query, visualize, alert on, and explore your metrics,
|
> [Grafana] enables you to query, visualize, alert on, and explore your metrics,
|
||||||
> logs, and traces wherever they are stored.
|
> logs, and traces wherever they are stored.
|
||||||
|
|
@ -8,13 +8,14 @@ Use [Grafana](https://grafana.com/) to query and visualize data stored in
|
||||||
>
|
>
|
||||||
> {{% cite %}}-- [Grafana documentation](https://grafana.com/docs/grafana/latest/introduction/){{% /cite %}}
|
> {{% cite %}}-- [Grafana documentation](https://grafana.com/docs/grafana/latest/introduction/){{% /cite %}}
|
||||||
|
|
||||||
- [Install Grafana or login to Grafana Cloud](#install-grafana-or-login-to-grafana-cloud)
|
- [Install Grafana or log in to Grafana Cloud](#install-grafana-or-log-in-to-grafana-cloud)
|
||||||
- [InfluxDB data source](#influxdb-data-source)
|
- [InfluxDB data source](#influxdb-data-source)
|
||||||
|
- [Before you begin](#before-you-begin)
|
||||||
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
- [Create an InfluxDB data source](#create-an-influxdb-data-source)
|
||||||
- [Query InfluxDB with Grafana](#query-influxdb-with-grafana)
|
- [Query InfluxDB with Grafana](#query-influxdb-with-grafana)
|
||||||
- [Build visualizations with Grafana](#build-visualizations-with-grafana)
|
- [Build visualizations with Grafana](#build-visualizations-with-grafana)
|
||||||
|
|
||||||
## Install Grafana or login to Grafana Cloud
|
## Install Grafana or log in to Grafana Cloud
|
||||||
|
|
||||||
If using the open source version of **Grafana**, follow the
|
If using the open source version of **Grafana**, follow the
|
||||||
[Grafana installation instructions](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)
|
[Grafana installation instructions](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)
|
||||||
|
|
@ -24,8 +25,8 @@ If using **Grafana Cloud**, log in to your Grafana Cloud instance.
|
||||||
## InfluxDB data source
|
## InfluxDB data source
|
||||||
|
|
||||||
The InfluxDB data source plugin is included in the Grafana core distribution.
|
The InfluxDB data source plugin is included in the Grafana core distribution.
|
||||||
Use the plugin to query and visualize data stored in {{< product-name >}} with
|
Use the plugin to query and visualize data from {{< product-name >}} with
|
||||||
both InfluxQL and SQL.
|
both SQL and InfluxQL.
|
||||||
|
|
||||||
> [!Note]
|
> [!Note]
|
||||||
> #### Grafana 10.3+
|
> #### Grafana 10.3+
|
||||||
|
|
@ -33,18 +34,41 @@ both InfluxQL and SQL.
|
||||||
> The instructions below are for **Grafana 10.3+** which introduced the newest
|
> The instructions below are for **Grafana 10.3+** which introduced the newest
|
||||||
> version of the InfluxDB core plugin.
|
> version of the InfluxDB core plugin.
|
||||||
> The updated plugin includes **SQL support** for InfluxDB 3-based products such
|
> The updated plugin includes **SQL support** for InfluxDB 3-based products such
|
||||||
> as {{< product-name >}}.
|
> as {{< product-name >}}, and the interface dynamically adapts based on your product and query language selections.
|
||||||
|
|
||||||
|
## Before you begin
|
||||||
|
|
||||||
|
**Prerequisites:**
|
||||||
|
- Grafana 10.3 or later
|
||||||
|
- Administrator role in Grafana
|
||||||
|
- {{% show-in "cloud-serverless" %}}An [API token](/influxdb3/version/admin/tokens/) with read access to the bucket{{% /show-in %}}{{% show-in "cloud-dedicated, clustered" %}}A [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the database{{% /show-in %}}{{% show-in "core,enterprise" %}}Your {{% token-link "admin" "database" %}} with read access to the database{{% /show-in %}}
|
||||||
|
|
||||||
|
### Quick reference: {{< product-name >}} configuration
|
||||||
|
|
||||||
|
| Configuration | Value |
|
||||||
|
|:------------- |:----- |
|
||||||
|
| **Product selection** | {{% hide-in "core,enterprise" %}}**{{% product-name %}}**{{% /hide-in %}}{{% show-in "core" %}}**InfluxDB Core 3.x**{{% /show-in %}}{{% show-in "enterprise" %}}**InfluxDB Enterprise 3.x**{{% /show-in %}} |
|
||||||
|
| **Default URL** | {{% show-in "core, enterprise" %}}`http://localhost:8181`{{% /show-in %}}{{% show-in "cloud-serverless, cloud-dedicated, clustered" %}}`https://{{< influxdb/host >}}`{{% /show-in %}} |
|
||||||
|
| **Query languages** | SQL (requires HTTP/2), InfluxQL |
|
||||||
|
| **Authentication** | {{% show-in "cloud-serverless" %}}Required (API token){{% /show-in %}}{{% show-in "core" %}}Optional (admin token){{% /show-in %}}{{% show-in "enterprise" %}}Optional (admin or database token){{% /show-in %}}{{% show-in "cloud-dedicated, clustered" %}}Required (database token){{% /show-in %}} |
|
||||||
|
| **Database/Bucket** | {{% show-in "cloud-serverless" %}}Bucket name{{% /show-in %}}{{% hide-in "cloud-serverless" %}}Database name{{% /hide-in %}} |
|
||||||
|
|
||||||
## Create an InfluxDB data source
|
## Create an InfluxDB data source
|
||||||
|
|
||||||
Which data source you create depends on which query language you want to use to
|
1. In your Grafana interface, click **Connections** in the left sidebar.
|
||||||
query {{% product-name %}}:
|
2. Click **Data sources**.
|
||||||
|
3. Click **Add new data source**.
|
||||||
|
4. Search for and select **InfluxDB**. The InfluxDB data source configuration page displays.
|
||||||
|
5. In the **Settings** tab, configure the following:
|
||||||
|
|
||||||
1. In your Grafana user interface (UI), navigate to **Data Sources**.
|
- **Name**: Enter a descriptive name for your data source
|
||||||
2. Click **Add new data source**.
|
- **URL**: Enter your {{% product-name %}}{{% show-in "cloud-dedicated, clustered" %}} cluster URL{{% /show-in %}}{{% show-in "cloud-serverless" %}} region URL{{% /show-in %}}{{% show-in "core, enterprise" %}} instance URL{{% /show-in %}}: `https://{{< influxdb/host >}}`
|
||||||
3. Search for and select the **InfluxDB** plugin.
|
- **Product**: From the dropdown, select {{% hide-in "core,enterprise" %}}**{{% product-name %}}**{{% /hide-in %}}{{% show-in "core" %}}**InfluxDB Core 3.x**{{% /show-in %}}{{% show-in "enterprise" %}}**InfluxDB Enterprise 3.x**{{% /show-in %}}
|
||||||
4. Provide a name for your data source.
|
- **Query Language**: Select **SQL** or **InfluxQL**
|
||||||
5. Under **Query Language**, select either **SQL** or **InfluxQL**:
|
|
||||||
|
### Configure database settings
|
||||||
|
|
||||||
|
The fields in this section change based on your query language selection.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
|
|
@ -54,66 +78,65 @@ query {{% product-name %}}:
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
<!--------------------------------- BEGIN SQL --------------------------------->
|
<!--------------------------------- BEGIN SQL --------------------------------->
|
||||||
|
|
||||||
When creating an InfluxDB data source that uses SQL to query data:
|
#### SQL configuration
|
||||||
|
|
||||||
1. Under **HTTP**:
|
When you select **SQL** as the query language, configure the following fields:
|
||||||
|
|
||||||
- **URL**: Provide your {{% show-in "cloud-serverless" %}}[{{< product-name >}} region URL](/influxdb3/version/reference/regions/){{% /show-in %}}
|
- **Database**: {{% show-in "cloud-serverless" %}}Your [bucket](/influxdb3/version/admin/buckets/) name. In {{< product-name >}}, buckets function as databases.{{% /show-in %}}{{% hide-in "cloud-serverless" %}}Your [database](/influxdb3/version/admin/databases/) name.{{% /hide-in %}}
|
||||||
{{% hide-in "cloud-serverless" %}}{{% product-name omit=" Clustered" %}} cluster URL{{% /hide-in %}} using the HTTPS protocol:
|
|
||||||
|
|
||||||
```
|
- **Token**: {{% show-in "cloud-serverless" %}}An [API token](/influxdb3/version/admin/tokens/) with read access to the bucket{{% /show-in %}}{{% show-in "cloud-dedicated, clustered" %}}A [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the database{{% /show-in %}}{{% show-in "core, enterprise" %}}Your {{% token-link "admin" "database" %}} with read access to the database{{% /show-in %}}
|
||||||
https://{{< influxdb/host >}}
|
|
||||||
```
|
|
||||||
2. Under **InfluxDB Details**:
|
|
||||||
|
|
||||||
- **Database**: Provide a default {{% show-in "cloud-serverless" %}}[bucket](/influxdb3/version/admin/buckets/) name to query. In {{< product-name >}}, a bucket functions as a database.{{% /show-in %}}{{% hide-in "cloud-serverless" %}}[database](/influxdb3/version/admin/databases/) name to query.{{% /hide-in %}}
|
{{% show-in "cloud-serverless" %}}{{< img-hd src="/img/influxdb3/cloud-serverless-grafana-product-dropdown-sql.png" alt="SQL configuration for {{% product-name %}}" />}}{{% /show-in %}}
|
||||||
- **Token**: Provide {{% show-in "cloud-serverless" %}}an [API token](/influxdb3/version/admin/tokens/) with read access to the buckets you want to query.{{% /show-in %}}{{% hide-in "cloud-serverless" %}}a [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the databases you want to query.{{% /hide-in %}}
|
{{% show-in "cloud-dedicated" %}}{{< img-hd src="/img/influxdb3/cloud-dedicated-grafana-product-dropdown-sql.png" alt="SQL configuration for {{% product-name %}}" />}}{{% /show-in %}}
|
||||||
3. Click **Save & test**.
|
{{% show-in "clustered" %}}{{< img-hd src="/img/influxdb3/cluster-grafana-product-dropdown-sql.png" alt="SQL configuration for {{% product-name %}}" />}}{{% /show-in %}}
|
||||||
|
{{% show-in "core, enterprise" %}}{{< img-hd src="/img/influxdb3/enterprise-v3-grafana-product-dropdown-sql.png" alt="SQL configuration for {{% product-name %}}" />}}{{% /show-in %}}
|
||||||
|
|
||||||
{{% show-in "cloud-serverless" %}}{{< img-hd src="/img/influxdb3/cloud-serverless-grafana-influxdb-data-source-sql.png" alt="Grafana InfluxDB data source for InfluxDB Cloud Serverless that uses SQL" />}}{{% /show-in %}}
|
> [!Important]
|
||||||
{{% show-in "cloud-dedicated" %}}{{< img-hd src="/img/influxdb/cloud-dedicated-grafana-influxdb-data-source-sql.png" alt="Grafana InfluxDB data source for InfluxDB Cloud Dedicated that uses SQL" />}}{{% /show-in %}}
|
> #### Grafana queries through a proxy require HTTP/2
|
||||||
{{% show-in "clustered" %}}{{< img-hd src="/img/influxdb3/clustered-grafana-influxdb-data-source-sql.png" alt="Grafana InfluxDB data source for InfluxDB Clustered that uses SQL" />}}{{% /show-in %}}
|
>
|
||||||
|
> For SQL queries, Grafana uses the Flight SQL protocol (gRPC) to query {{% product-name %}}, which requires **HTTP/2**.
|
||||||
|
> If you query {{% product-name %}} through a proxy (such as HAProxy, nginx, or a load balancer),
|
||||||
|
> verify that your proxy is configured to support HTTP/2.
|
||||||
|
> Without HTTP/2 support, SQL queries through Grafana will fail to connect.
|
||||||
|
>
|
||||||
|
> InfluxQL queries use HTTP/1.1 and are not affected by this requirement.
|
||||||
|
|
||||||
|
Click **Save & test**. Grafana attempts to connect to {{% product-name %}} and returns the result of the test.
|
||||||
|
|
||||||
<!---------------------------------- END SQL ---------------------------------->
|
<!---------------------------------- END SQL ---------------------------------->
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
{{% tab-content %}}
|
{{% tab-content %}}
|
||||||
<!------------------------------- BEGIN INFLUXQL ------------------------------>
|
<!------------------------------- BEGIN INFLUXQL ------------------------------>
|
||||||
|
|
||||||
When creating an InfluxDB data source that uses InfluxQL to query data:
|
#### InfluxQL configuration
|
||||||
|
|
||||||
{{% show-in "cloud-serverless" %}}
|
{{% show-in "cloud-serverless" %}}
|
||||||
> [!Note]
|
> [!Important]
|
||||||
> #### Map databases and retention policies to buckets
|
> #### DBRP mapping required
|
||||||
>
|
>
|
||||||
> To query {{% product-name %}} with InfluxQL, first map database and retention policy
|
> To query {{% product-name %}} with InfluxQL, you must first map database and
|
||||||
> (DBRP) combinations to your InfluxDB Cloud buckets. For more information, see
|
> retention policy (DBRP) combinations to your InfluxDB Cloud buckets. The
|
||||||
> [Map databases and retention policies to buckets](/influxdb3/version/query-data/influxql/dbrp/).
|
> configuration form displays a warning if DBRP mapping is not configured.
|
||||||
|
>
|
||||||
|
> For more information, see [Map databases and retention policies to buckets](/influxdb3/version/query-data/influxql/dbrp/).
|
||||||
{{% /show-in %}}
|
{{% /show-in %}}
|
||||||
|
|
||||||
1. Under **HTTP**:
|
When you select **InfluxQL** as the query language, configure the following fields:
|
||||||
|
|
||||||
- **URL**: Provide your {{% show-in "cloud-serverless" %}}[{{< product-name >}} region URL](/influxdb3/version/reference/regions/){{% /show-in %}}{{% hide-in "cloud-serverless" %}}{{% product-name omit=" Clustered" %}} cluster URL{{% /hide-in %}}
|
- **Database**: {{% show-in "cloud-serverless" %}}The database name mapped to your InfluxDB bucket.{{% /show-in %}}{{% hide-in "cloud-serverless" %}}Your [database](/influxdb3/version/admin/databases/) name.{{% /hide-in %}}
|
||||||
using the HTTPS protocol:
|
|
||||||
|
|
||||||
```
|
- **User**: Enter a username (can be any non-empty value).
|
||||||
https://{{< influxdb/host >}}
|
|
||||||
```
|
|
||||||
2. Under **InfluxDB Details**:
|
|
||||||
|
|
||||||
- **Database**: Provide a {{% show-in "cloud-serverless" %}}database name to query.
|
- **Password**: {{% show-in "cloud-serverless" %}}Your [API token](/influxdb3/version/admin/tokens/) with read access to the bucket.{{% /show-in %}}{{% hide-in "cloud-serverless" %}}Your [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the database.{{% /hide-in %}}
|
||||||
Use the database name that is mapped to your InfluxDB bucket{{% /show-in %}}{{% hide-in "cloud-serverless" %}}default [database](/influxdb3/version/admin/databases/) name to query{{% /hide-in %}}.
|
|
||||||
- **User**: Provide an arbitrary string.
|
|
||||||
_This credential is ignored when querying {{% product-name %}}, but it cannot be empty._
|
|
||||||
- **Password**: Provide {{% show-in "cloud-serverless" %}}an [API token](/influxdb3/version/admin/tokens/) with read access to the buckets you want to query{{% /show-in %}}{{% hide-in "cloud-serverless" %}}a [database token](/influxdb3/version/admin/tokens/#database-tokens) with read access to the databases you want to query{{% /hide-in %}}.
|
|
||||||
- **HTTP Method**: Choose one of the available HTTP request methods to use when querying data:
|
|
||||||
|
|
||||||
- **POST** ({{< req text="Recommended" >}})
|
- **HTTP Method**: Select **POST** (recommended) or **GET**
|
||||||
- **GET**
|
|
||||||
3. Click **Save & test**.
|
|
||||||
|
|
||||||
{{% show-in "cloud-dedicated" %}}{{< img-hd src="/img/influxdb/cloud-dedicated-grafana-influxdb-data-source-influxql.png" alt="Grafana InfluxDB data source for InfluxDB Cloud Dedicated using InfluxQL" />}}{{% /show-in %}}
|
{{% show-in "cloud-serverless" %}}{{< img-hd src="/img/influxdb3/cloud-serverless-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for {{% product-name %}} with DBRP warning" />}}{{% /show-in %}}
|
||||||
{{% show-in "cloud-serverless" %}}{{< img-hd src="/img/influxdb3/cloud-serverless-grafana-influxdb-data-source-influxql.png" alt="Grafana InfluxDB data source for InfluxDB Cloud Serverless using InfluxQL" />}}{{% /show-in %}}
|
{{% show-in "cloud-dedicated" %}}{{< img-hd src="/img/influxdb3/cloud-dedicated-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for {{% product-name %}} with DBRP warning" />}}{{% /show-in %}}
|
||||||
{{% show-in "clustered" %}}{{< img-hd src="/img/influxdb3/clustered-grafana-influxdb-data-source-influxql.png" alt="Grafana InfluxDB data source for InfluxDB Clustered using InfluxQL" />}}{{% /show-in %}}
|
{{% show-in "clustered" %}}{{< img-hd src="/img/influxdb3/cluster-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for {{% product-name %}} with DBRP warning" />}}{{% /show-in %}}
|
||||||
|
{{% show-in "core, enterprise" %}}{{< img-hd src="/img/influxdb3/enterprise-v3-grafana-product-dropdown-influxql.png" alt="InfluxQL configuration for {{% product-name %}} with DBRP warning" />}}{{% /show-in %}}
|
||||||
|
|
||||||
|
Click **Save & test**. Grafana attempts to connect to {{% product-name %}} and returns the result of the test.
|
||||||
|
|
||||||
<!-------------------------------- END INFLUXQL ------------------------------->
|
<!-------------------------------- END INFLUXQL ------------------------------->
|
||||||
{{% /tab-content %}}
|
{{% /tab-content %}}
|
||||||
|
|
@ -122,7 +145,7 @@ When creating an InfluxDB data source that uses InfluxQL to query data:
|
||||||
## Query InfluxDB with Grafana
|
## Query InfluxDB with Grafana
|
||||||
|
|
||||||
After you [configure and save an InfluxDB datasource](#create-an-influxdb-data-source),
|
After you [configure and save an InfluxDB datasource](#create-an-influxdb-data-source),
|
||||||
use Grafana to build, run, and inspect queries against your InfluxDB {{% show-in "cloud-serverless" %}}bucket{{% /show-in %}}{{% hide-in "cloud-serverless" %}}database{{% /hide-in %}}.
|
use Grafana to build, run, and inspect queries against {{% show-in "cloud-serverless" %}}your InfluxDB bucket{{% /show-in %}}{{% hide-in "cloud-serverless" %}}{{% product-name %}}{{% /hide-in %}}.
|
||||||
|
|
||||||
{{< tabs-wrapper >}}
|
{{< tabs-wrapper >}}
|
||||||
{{% tabs %}}
|
{{% tabs %}}
|
||||||
|
|
@ -139,7 +162,7 @@ use Grafana to build, run, and inspect queries against your InfluxDB {{% show-in
|
||||||
1. Click **Explore**.
|
1. Click **Explore**.
|
||||||
2. In the dropdown, select the saved InfluxDB data source to query.
|
2. In the dropdown, select the saved InfluxDB data source to query.
|
||||||
3. Use the SQL query form to build your query:
|
3. Use the SQL query form to build your query:
|
||||||
- **Table**: Select the measurement to query.
|
- **Table**: Select the table (measurement) to query.
|
||||||
- **Column**: Select one or more fields and tags to return as columns in query results.
|
- **Column**: Select one or more fields and tags to return as columns in query results.
|
||||||
|
|
||||||
With SQL, select the `time` column to include timestamps with the data.
|
With SQL, select the `time` column to include timestamps with the data.
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 291 KiB |
|
After Width: | Height: | Size: 322 KiB |
|
After Width: | Height: | Size: 329 KiB |
|
After Width: | Height: | Size: 360 KiB |
|
After Width: | Height: | Size: 305 KiB |
|
After Width: | Height: | Size: 324 KiB |
|
After Width: | Height: | Size: 440 KiB |
|
After Width: | Height: | Size: 350 KiB |
|
After Width: | Height: | Size: 335 KiB |
|
After Width: | Height: | Size: 290 KiB |
|
After Width: | Height: | Size: 324 KiB |
|
After Width: | Height: | Size: 283 KiB |
|
After Width: | Height: | Size: 334 KiB |
|
After Width: | Height: | Size: 280 KiB |
|
After Width: | Height: | Size: 322 KiB |
|
After Width: | Height: | Size: 296 KiB |
|
After Width: | Height: | Size: 409 KiB |
|
After Width: | Height: | Size: 244 KiB |
|
After Width: | Height: | Size: 362 KiB |