Plugins 〉AstraDB

Grafana Labs


Sign up to receive occasional product news and updates:

Data Source


  • Overview
  • Installation
  • Change log
  • Related content

Astra DB data source plugin for Grafana

The Astra DB plugin allows a direct connection to Astra DB to query and visualize data in Grafana.

This plugin provides a CQL editor to format and color code your CQL statements, along with auto complete when entering keyspaces, tables and fields.


This plugin is currently in Beta development. Breaking changes could occur but are not expected.


For detailed instructions on how to install the plugin on Grafana Cloud or locally, please checkout the Plugin installation docs.


Once the plugin is installed on your Grafana instance, follow these instructions to add a new Astra DB data source, and enter configuration options.

Connect to Astra DB with authentication token

URIProvide an Astra DB URI in the following format: $ASTRA_CLUSTER_ID-$
TokenProvide an Astra DB token in the following format: AstraCS:xxxxx. See Manage Application Tokens for more on authentication.

Connect to Cassandra with credentials ( requires Stargate )

GRPC EndpointGRPC Endpoint to Stargate. Example: localhost:8090
Auth EndpointAuthentication Endpoint to Stargate. Example: localhost:8081
User NameCassandra database user name
PasswordCassandra database password
SecureCheck if secure connection is required

Configure via provisioning file

It is possible to configure data sources using configuration files with Grafana’s provisioning system. To read about how it works, including all the settings that you can set for this data source, refer to Provisioning Grafana data sources.

Here is a provisioning example for this data source using token authentication:

apiVersion: 1
  - name: AstraDB
    type: grafana-astradb-datasource
      uri: $ASTRA_CLUSTER_ID-$
      token: AstraCS:xxxxx

Time series

Time series visualization options are selectable after adding a timestamp field type to your query. This field will be used as the timestamp. You can select time series visualizations using the visualization options. Grafana interprets timestamp rows without explicit time zone as UTC.

Multi-line time series

To create multi-line time series, the query must return at least 3 fields in the following order:

  • field 1: timestamp field with an alias of time
  • field 2: value to group by
  • field 3+: the metric values

For example:

SELECT time_field AS time, metric_name, avg(metric_value) AS avg_metric_value
FROM keyspace.table
GROUP BY metric_name, time_field
ORDER BY time_field


To allowing injection of date range filters, the query can contain macros.

Here is an example of a query with a macros that will use the dashboard time range:

SELECT timestampvalue as time, bigintvalue, textvalue FROM grafana.tempTable1
where timestampvalue $__timeFrom and timestampvalue $__timeTo Allow Filtering

The query is converted to:

SELECT timestampvalue as time, bigintvalue, textvalue FROM grafana.tempTable1
where timestampvalue  >= '2021-07-07T12:04:16Z' and timestampvalue  <= '2021-11-08T21:26:04Z' Allow Filtering

Templates and variables

To add a new query variable, refer to Add a query variable.

After creating a variable, you can use it in your CQL queries by using Variable syntax. For more information about variables, refer to Templates and variables.

Learn more

Installing AstraDB on Grafana Cloud:

For more information, visit the docs on plugin installation.



  • Chore - Dependency updates
  • Chore - Clean up some deprecated methods


  • Chore - Dependency updates


  • Chore - Bump from 0.180.0 to 0.196.0
  • Chore - Other dependency updates


  • Chore - Security update.


  • Chore - Build with latest Go version 1.20.4


  • Chore - Updated with the latest version of Go (1.20.3)


  • Chore - Updated with the latest version of Go (1.19.4)
  • Chore - Updated with the latest Grafana backend dependencies


  • Chore - Update docs with credentials based connection


  • Feature - Authenticate with Credentials


  • Feature - Add query builder


  • Bug Fix - Fixed a bug where null values in result causing panic


  • Initial Beta release - Features
  • Query Editor with meta lookups/autocomplete
  • Template variables
  • Query type variables
  • Time macros
  • Time series - convention using "time" alias
  • Simple and Complex data types supported
  • Custom Variable Editor