This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.

Grafana Cloud Enterprise Open source
Last reviewed: August 4, 2026

InfluxDB data source

InfluxDB is an open-source time series database (TSDB) developed by InfluxData. It is optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, IoT sensor data, and real-time analytics.

Grafana ships with the InfluxDB data source out of the box. The data source is preinstalled in both Grafana OSS and Grafana Enterprise, so there’s nothing for you to install. It’s packaged as a standalone plugin that Grafana can update independently of Grafana releases. For details, refer to Plugin updates.

Grafana offers multiple configuration options for this data source, including a choice of three query languages (SQL, InfluxQL, and Flux). SQL and InfluxQL provide both visual builder and code editing modes, while Flux provides a code editor only.

Supported versions

This data source supports the following InfluxDB products:

  • InfluxDB OSS 1.x, 2.x, and 3.x
  • InfluxDB Enterprise 1.x and 3.x
  • InfluxDB Cloud Serverless
  • InfluxDB Cloud Dedicated
  • InfluxDB Cloud (TSM)

Supported features

FeatureSupported
MetricsYes
LogsYes
TracesNo
AlertingYes
AnnotationsYes

Get started

The following documents help you set up and use the InfluxDB data source:

Additional features

After configuring the data source, you can:

Plugin updates

Starting with Grafana v13.2, the InfluxDB data source is a standalone plugin, preinstalled in both Grafana OSS and Enterprise. This enables more frequent updates independent of Grafana releases. Grafana automatically checks the plugin catalog and installs the latest version on each server restart.

To adjust this behavior:

  • Opt out of auto-updates: Set preinstall_auto_update to false in your configuration file.
  • Update manually: Update at any time from the Administration > Plugins page without restarting Grafana.

The standalone plugin requires Grafana 12.3.0 or later. The InfluxDB data source bundled with Grafana 13.1 and earlier continues to work as before. Those versions are unaffected by this change.

Caution

Grafana recommends running plugin version 13.1.0 or later. Earlier versions could write API tokens to Grafana server logs in plain text at default log levels. If you’ve run an earlier version, treat your server logs as sensitive and rotate any tokens that may have been exposed.

Users running Grafana 12.3.x through 13.1.x can install the standalone plugin from the plugin catalog if they want the latest features before upgrading to Grafana 13.2. To use the standalone plugin with these versions, add the following to your configuration file:

ini
[plugin.influxdb]
as_external = true

[plugins]
; Install the latest version on startup:
preinstall_sync = influxdb
; Or install a specific version:
; preinstall_sync = influxdb@<version>

On self-managed Grafana, you control the plugin version. To roll back after a problematic update, pin a known-good version with preinstall_sync = influxdb@<version> and restart Grafana, or install a specific version from the Administration > Plugins page.

Note

In Grafana Cloud, plugin updates are managed automatically. You can’t pin the plugin to a specific version or roll back to a previous one yourself. If a plugin update causes problems with your dashboards or queries, contact Grafana Support.

Query with the Grafana CLI

You can query this data source from the command line and from AI coding agents using the Grafana CLI, gcx. gcx gives you and your agent structured, terminal-based access to your Grafana data sources, which is useful for automation and agent-driven investigations.

gcx supports Grafana Cloud and Grafana OSS or Enterprise v12 and later. Before you query, install and authenticate gcx. Refer to the gcx CLI documentation for installation, configuration, and the full command reference.

For example, to query your InfluxDB data source, use the gcx datasources influxdb commands:

sh
# Run a query (InfluxQL, Flux, or SQL, auto-detected from the data source)
gcx datasources influxdb query -d <DATASOURCE_UID> 'SELECT mean("value") FROM "cpu" WHERE time > now() - 1h'

# List measurements (add --bucket to use Flux mode)
gcx datasources influxdb list-measurements -d <DATASOURCE_UID>

# List field keys and tag keys, optionally filtered by measurement
gcx datasources influxdb list-field-keys -d <DATASOURCE_UID> --measurement cpu
gcx datasources influxdb list-tag-keys -d <DATASOURCE_UID> --measurement cpu

# List the values for a tag key
gcx datasources influxdb list-tag-values -d <DATASOURCE_UID> --key host

Replace <DATASOURCE_UID> with the UID of your InfluxDB data source. You can omit the -d flag when datasources.influxdb is configured in your gcx context. The list-field-keys, list-tag-keys, and list-tag-values commands work in InfluxQL mode only.