Use Grafana with InfluxDB OSS
Use Grafana or Grafana Cloud to visualize data from your InfluxDB 2.7 instance.
The instructions in this guide require Grafana Cloud or Grafana 10.3+.
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, open the Connections section and select Add new connection.
Select InfluxDB from the list of available data sources and click Add new data source.
On the Data Source configuration page, enter a name for your InfluxDB data source.
In the Query Language drop-down menu, select one of the query languages supported by InfluxDB 2.7 (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:
Under HTTP, enter the following:
URL: Your InfluxDB URL.
http://localhost:8086/
Under InfluxDB Details, enter the following:
- Organization: Your InfluxDB organization name or ID.
- Token: Your InfluxDB API token.
- Default Bucket: The default bucket to use in Flux queries.
- Min time interval: The Grafana minimum time interval.
Default is
10s
- Max series: The maximum number of series or tables Grafana will process.
Default is
1000
.
Click Save & Test. Grafana attempts to connect to the InfluxDB 2.7 datasource and returns the results of the test.
Configure Grafana to use InfluxQL
To query InfluxDB 2.7 with InfluxQL, find your use case below, and then complete the instructions to configure Grafana:
- Installed a new InfluxDB 2.7 instance
- Upgraded from InfluxDB 1.x to 2.7 (following the official upgrade)
- Manually migrated from InfluxDB 1.x to 2.7
Installed a new InfluxDB instance
To configure Grafana to use InfluxQL with a new install of InfluxDB 2.7, do the following:
Upgraded from InfluxDB 1.x to 2.x
To configure Grafana to use InfluxQL when you’ve upgraded from InfluxDB 1.x to InfluxDB 2.7 (following an official upgrade guide):
- Authenticate using the non-admin v1 compatible authentication credentials created during the upgrade process.
- Use the DBRP mappings InfluxDB automatically created in the upgrade process (no action necessary).
Manually migrated from InfluxDB 1.x to 2.x
To configure Grafana to use InfluxQL when you’ve manually migrated from InfluxDB 1.x to InfluxDB 2.7, do the following:
- If your InfluxDB 1.x instance required authentication, create v1 compatible authentication credentials to match your previous 1.x username and password. Otherwise, use InfluxDB v2 token authentication.
- Manually create DBRP mappings.
Configure your InfluxDB connection
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/
Configure InfluxDB authentication:
Token authentication
Under Custom HTTP Headers, select Add Header. Provide your InfluxDB API token:
Header: Enter
Authorization
Value: Use the
Token
schema and provide your InfluxDB API token. For example:Token y0uR5uP3rSecr3tT0k3n
Under InfluxDB Details, do the following:
- Database: Enter the database name mapped to your InfluxDB 2.7 bucket
- HTTP Method: Select GET
Authenticate with username and password
Under InfluxDB Details, do the following:
- Database: Enter the database name mapped to your InfluxDB 2.7 bucket
- User: Enter the username associated with your InfluxDB 1.x compatibility authorization
- Password: Enter the password associated with your InfluxDB 1.x compatibility authorization
- HTTP Method: Select GET
Click Save & Test. Grafana attempts to connect to the InfluxDB 2.7 data source and returns the results of the test.
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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.