Documentation

Use Grafana with InfluxDB Cloud

Use Grafana or Grafana Cloud to visualize data from your InfluxDB Cloud instance.

The instructions in this guide require Grafana Cloud or Grafana 10.3+.

  1. Log into InfluxDB Cloud.

  2. Sign up for Grafana Cloud or download and install Grafana.

  3. Visit your Grafana Cloud user interface (UI) or, if running Grafana locally, start Grafana and visit 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 Cloud (Flux or InfluxQL):

    SQL is only supported in InfluxDB v3.

Configure Grafana to use Flux

With Flux selected as the query language in your InfluxDB data source, configure your InfluxDB connection:

  1. Under HTTP, enter the following:

  2. Under InfluxDB Details, enter the following:

  3. Click Save & Test. Grafana attempts to connect to the InfluxDB Cloud datasource and returns the results of the test.

Use Grafana with InfluxDB Cloud and Flux

Configure Grafana to use InfluxQL

To query InfluxDB Cloud from Grafana using InfluxQL:

  1. Download and set up the influx CLI
  2. Create an InfluxDB DBRP mapping
  3. Configure your InfluxDB connection

Download and set up the influx CLI

  1. Download the latest version of 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 and provide the following:

    influx config create \
      --config-name example-config-name \
      --host-url https://cloud2.influxdata.com \
      --org example-org \
      --token My5uP3rSeCr37t0k3n
    

    For more information about influx CLI configurations, see 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 command to create a database/retention policy (DBRP) mapping that associates a database and retention policy combination with an InfluxDB Cloud 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.

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.

Provide the following:

  • database name
  • retention policy name (not retention period)
  • bucket ID
  • (optional) --default flag if you want the retention policy to be the default retention policy for the specified database
influx v1 dbrp create \
  --db example-db \
  --rp example-rp \
  --bucket-id 00xX00o0X001 \
  --default

Repeat for each DBRP combination

Each unique database and retention policy combination used by Grafana must be mapped to an InfluxDB Cloud 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.

For more information about DBRP mapping, see Database and retention policy mapping.

Configure your InfluxDB connection

With InfluxQL selected as the query language in your InfluxDB data source settings:

  1. Under HTTP, enter the following:

  2. Configure InfluxDB authentication:

  3. Click Save & Test. Grafana attempts to connect to the InfluxDB Cloud data source and returns the results of the test.

Use Grafana with InfluxDB Cloud and Flux

Query and visualize data

With your InfluxDB connection configured, use Grafana and Flux to query and visualize time series data stored in your InfluxDB instance.

For more information about using Grafana, see the Grafana documentation. If you’re just learning Flux, see Get started with Flux.


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered

InfluxDB Cloud powered by TSM