Plugins 〉AstraDB
AstraDB
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.
Beta
This plugin is currently in Beta development. Breaking changes could occur but are not expected.
Installation
For detailed instructions on how to install the plugin on Grafana Cloud or locally, please checkout the Plugin installation docs.
Configuration
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
Key | Description |
---|---|
URI | Provide an Astra DB URI in the following format: $ASTRA_CLUSTER_ID-$ASTRA_REGION.apps.astra.datastax.com:443 |
Token | Provide 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 )
Key | Description |
---|---|
GRPC Endpoint | GRPC Endpoint to Stargate. Example: localhost:8090 |
Auth Endpoint | Authentication Endpoint to Stargate. Example: localhost:8081 |
User Name | Cassandra database user name |
Password | Cassandra database password |
Secure | Check 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
datasources:
- name: AstraDB
type: grafana-astradb-datasource
jsonData:
uri: $ASTRA_CLUSTER_ID-$ASTRA_REGION.apps.astra.datastax.com:443
secureJsonData:
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 oftime
- 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
Macros
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
- Add Annotations.
- Configure and use Templates and variables.
- Add Transformations.
- Set up alerting; refer to Alerts overview.
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing AstraDB on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Data Source
Use the grafana-cli tool to install AstraDB from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Configure the Data Source
Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.
Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.
To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.
Changelog
0.6.3
- Chore - Dependency updates
0.6.2
- Chore - Dependency updates
- Chore - Add
errorsource
#337
0.6.1
- Chore - Dependency updates
0.6.0
- Chore - Dependency updates
- Chore - Clean up some deprecated methods
0.5.0
- Chore - Dependency updates
0.4.0
- Chore - Bump github.com/grafana/grafana-plugin-sdk-go from 0.180.0 to 0.196.0
- Chore - Other dependency updates
0.3.2
- Chore - Security update.
0.3.1
- Chore - Build with latest Go version 1.20.4
0.3.0
- Chore - Updated with the latest version of Go (1.20.3)
0.2.2
- Chore - Updated with the latest version of Go (1.19.4)
- Chore - Updated with the latest Grafana backend dependencies
0.2.1
- Chore - Update docs with credentials based connection
0.2.0
- Feature - Authenticate with Credentials
0.1.0
- Feature - Add query builder
0.0.2
- Bug Fix - Fixed a bug where null values in result causing panic
0.0.1
- 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