Use Grafana to visualize data
Use Grafana to query and visualize data stored in an InfluxDB bucket backed by InfluxDB IOx.
[Grafana] enables you to query, visualize, alert on, and explore your metrics, logs, and traces wherever they are stored. [Grafana] provides you with tools to turn your time-series database (TSDB) data into insightful graphs and visualizations.
For the most performant queries, use SQL and the Flight SQL protocol to query InfluxDB.
Download the FlightSQL Plugin
The Grafana FlightSQL plugin is experimental and is subject to change.
curl -L https://github.com/influxdata/grafana-flightsql-datasource/releases/download/v0.1.5/influxdata-flightsql-datasource-0.1.5.zip \
-o influxdata-flightsql-datasource-0.1.5.zip
Install the Grafana FlightSQL plugin
Install the custom-built FlightSQL plugin in a local or Docker-based instance of Grafana OSS or Grafana Enterprise.
Grafana Cloud does not support custom plugins
Only plugins that are uploaded publicly to the Grafana Plugins repo that include the ability to use “click to install” from the site can be added to your Grafana Cloud instance. Private, custom-built, or third-party plugins that require manual uploading or manually modifying Grafana backend files cannot be installed on or used with Grafana Cloud.
Unzip the FlightSQL plugin archive to your Grafana custom plugin directory. The custom plugin directory can exist anywhere in your filesystem as long as the Grafana process can access it.
unzip influxdata-flightsql-datasource-0.1.5.zip -d /path/to/grafana-plugins/
Edit your Grafana configuration.
Configure Grafana using configuration file or environment variable. For information about where to find your Grafana configuration file or what environment variables are available, see the Configure Grafana documentation.
Point Grafana to your custom plugin directory. Do one of the following:
Edit the
paths.plugins
directive in your Grafana configuration file to point to the path of your custom plugins directory:[paths] plugins = /path/to/grafana-plugins/
Set the
GF_PATHS_PLUGINS
environment variable to point to the path of your custom plugins directory:GF_PATHS_PLUGINS=/path/to/grafana-plugins/
Allow Grafana to load unsigned plugins. The FlightSQL plugin is unsigned and cannot be loaded by default. Do one of the following:
Edit the
plugins.allow_loading_unsigned_plugins
directive in your Grafana configuration file to allow theinfluxdata-flightsql-datasource
:[plugins] allow_loading_unsigned_plugins = influxdata-flightsql-datasource
Set the
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS
environment variable toinfluxdata-flightsql-datasource
:GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=influxdata-flightsql-datasource
Restart Grafana to apply the configuration changes.
Unzip the FlightSQL plugin archive to your Grafana custom plugin directory. The custom plugin directory can exist anywhere in your filesystem as long as the Grafana process can access it.
```sh
unzip influxdata-flightsql-datasource-0.1.2.zip
```
To add the FlightSQL plugin to your pre-existing Grafana Docker deployment
mount the plugin directory, influxdata-flightsql-datasource
, as a volume to your Grafana container:
Docker Run
docker run \
--volume $PWD/influxdata-flightsql-datasource:/var/lib/grafana/plugins/influxdata-flightsql-datasource \
--publish 3000:3000 \
--name grafana \
--env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=influxdata-flightsql-datasource \
grafana/grafana:latest
Docker-Compose
version: '3'
services:
grafana:
image: grafana/grafana:latest
ports:
- 3000:3000
environment:
- GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=influxdata-flightsql-datasource
volumes:
- ./influxdata-flightsql-datasource:/var/lib/grafana/plugins/influxdata-flightsql-datasource
restart: always
It’s important to set the GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS
environment variable. The FlightSQL plugin is unsigned and Grafana requires you
to explicitly load unsigned plugins.
Configure the Flight SQL datasource
In your Grafana user interface (UI), navigate to Data Sources.
Click Add data source.
Search for and select the FlightSQL plugin. 4 Provide a name for your datasource.
Add your connection credentials:
Host: Provide the host and port of your Flight SQL client. For InfluxDB Cloud, this is your InfluxDB Cloud region domain and port 443. For example:
us-east-1-1.aws.cloud2.influxdata.com:443
AuthType: Select token.
Token: Provide your InfluxDB API token with read access to the buckets you want to query.
Require TLS/SSL: Enable this toggle.
Add connection MetaData. Provide optional key, value pairs to send to your Flight SQL client.
InfluxDB Cloud requires your bucket name or bucket-id:
- Key:
bucket-name
orbucket-id
- Value: Bucket name or bucket ID
- Key:
Select Save & Test.
Click Explore to begin exploring your schema and querying InfluxDB with SQL.
Build visualizations with Grafana
For a comprehensive walk-through of creating visualizations with Grafana, see the Grafana documentation.
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:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.