Grafana
This page describes how to set up the Rockset Grafana plugin.
Introduction
Grafana is an open-source platform for analytics and monitoring. Using Grafana with Rockset is ideal for creating visualizations on your Rockset Collections and plotting timeseries data.
Configuration
- Get credentials from Rockset. Create and save a new API Key by navigating to the API Keys tab of the Rockset Console.
![](https://files.readme.io/adcdb43-Screenshot_2024-01-17_at_3.32.11_PM.png)
-
Set up Grafana. Set up Grafana if you have not already. The Grafana website has detailed instructions here.
-
Install plugin. Use grafana cli to install your plugin. You can
download the Rockset plugin by following the instructions here. -
Add configurations for the plugin. Because this is a backend plugin, it is required that the plugin is signed; however, the Grafana team hasn't implemented this yet. Thus, in the
[plugins]
section of your Grafana configuration file, you must addrockset-backend-datasource
to the list of allow_loading_unsigned_plugins. You may also set the environment variableGF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS
to includerockset-backend-datasource
for the plugin to be loaded.
[plugins]
allow_loading_unsigned_plugins = "rockset-backend-datasource"
- Navigate to Connections. From your Grafana homepage, go to
/connections
. You can type this in your browser, or click on the gear on the left side of the screen and click "Connections" under the configuration menu.
![](https://files.readme.io/0b83bf0-Screenshot_2024-02-01_at_2.03.31_PM.png)
- Add Rockset Data Source. Type 'Rockset' into the search bar with placeholder text "Filter by name or type", and click on the Rockset data source.
![](https://files.readme.io/9b9b2b6-Screenshot_2024-02-01_at_2.04.32_PM.png)
Click the "Add new data source" button.
- Enter credentials. Enter your API key and name your connector, then press "Save & Test". If you get an authentication failure, ensure your API key was pasted correctly. If you want the queries to execute on a specific virtual instance, enter the ID, or leave it blank to use the default virtual instance.
![](https://files.readme.io/6e641c0-Screenshot_2024-02-01_at_2.09.31_PM.png)
Usage
- Navigate to dashboard. Click on the plus on the left side of the screen, and click on "Dashboards".
![grafana_select_dashboard](https://files.readme.io/7329d22-Screenshot_2024-02-01_at_2.17.00_PM.png)
-
Add a new dashboard Click on "New dashboard".
-
Add a new visualization. Click on "Add visualization" in the new dashboard.
![grafana_new_panel](https://files.readme.io/1df4ea4-Screenshot_2024-02-01_at_2.19.19_PM.png)
- Select Rockset data source. Select your Rockset data source from the list.
![grafana_query_editor](https://files.readme.io/fa4ec58-Screenshot_2024-02-01_at_2.23.14_PM.png)
- Enter query. Enter your Rockset query into the text field. This query can be any SQL statement that is valid in the Rockset Console, but if you are using a graph visualization, you need a timeseries field. The plugin comes with a default query which shows the events from the
_events
collections.
![grafana_full_query](https://files.readme.io/8516c35-Screenshot_2024-02-01_at_2.25.07_PM.png)
-
(Optional) Select visualization. Choose a visualization from the visualization tab on the left of the screen to format your data in different ways.
-
View results. You should now be able to see your results and save your panel!
![grafana_results](https://files.readme.io/88bfb72-Screenshot_2024-02-01_at_2.27.40_PM.png)
Variables
The Rockset plugin allow you to extract variables using a SQL query.
-
Dashboard settings. Click the "Dashboard settings" in the upper left of the dashboard.
-
Variables Click the "Variables" section in the drop down menu.
-
Add a new variable Click "Add variable"
-
Enter query
-
(optional) Add an ALL option If you want to be able to show all values, select "Include All option" and enter
%
-
Apply Click the "Apply" button.
-
Open your panel Go back to your dashboard, and select "edit" on the panel
-
Edit the SQL query Add to the
WHERE
clause so it becomes. The$kind
will be replaced with the variable before the SQL is executed.WHERE e._event_time > :startTime AND e._event_time < :stopTime AND e.kind LIKE '$kind'
-
Select an event kind From the drop down menu, select one option
![](https://files.readme.io/fb9b845-Screenshot_2024-02-01_at_2.46.35_PM.png)
- Filtered view You now have a filtered view
![](https://files.readme.io/35524e2-Screenshot_2024-02-01_at_2.46.45_PM.png)
Updated 6 months ago