Plugins 〉GreptimeDB
GreptimeDB
GreptimeDB data source
GreptimeDB datasource for grafana
This plugin is currently campatiable with GreptimeDB 0.1.1-alpha.
Learn more about GreptimeDB Github | Website
!!!MENTION!!!
GreptimeDB currently is not production ready. Do not use it in production at the moment.
Using GreptimeDB in Grafana
Install GreptimeDB
Manually
Get GreptimeDB from Greptime's release page here.
This plugin is currently campatiable with GreptimeDB 0.1.1-alpha.
For demostration, run it in standalone mode ./greptime standalone start
. In case of port conflicts, start with option -c <config.toml>
. The format of config.toml
can be found here
Docker
There are also some docker images available on Docker Hub.
You can start a GreptimeDB instance with docker like this:
docker run -p 4000-4004:4000-4004 \
-p 4242:4242 \
-v "greptime-vol:/tmp/greptimedb" \
--name greptime \
greptime/greptimedb:0.1.1-alpha standalone start
Install The Plugin
Manually
Download the plugin from this repo's release page
Put the unzipped plugin folder into your grafana's plugin directory, which default at /var/lib/grafana/plugins
Restart your Grafana and the plugin will be loaded!
Add GreptimeDB data source in Grafana
Add a new data source in grafana, and select GreptimeDB.
As currently GreptimeDB has not implement any authentication yet, we just need to fill the URL input box.
Then click Save & test
. It will query numbers from your GreptimeDB to check if the data source is available. If the test result shows Success, you have successfully added your GreptimeDB as Grafana data source!
Visualize your data
If you are a new to GreptimeDB, you may need some dummy data for testing.
First, let's create a time-series table in GreptimeDB. GreptimeDB supports execute sql from HTTP API. You can use curl
to execute sql.
curl http://localhost:4000/v1/sql -d "sql=
CREATE TABLE system_metrics (
host STRING,
idc STRING,
cpu_util DOUBLE,
memory_util DOUBLE,
disk_util DOUBLE,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(host, idc),
TIME INDEX(ts))"
I have written a bash script for you to insert some dummy data.
sql="INSERT INTO system_metrics VALUES"
for i in {1..20}; do
host="host$(echo $i%3 | bc)"
idc="idc$(echo $i%3 | bc)"
cpu_util=$(echo "scale=2; $RANDOM/327.67" | bc)
memory_util=$(echo "scale=2; $RANDOM/327.67" | bc)
disk_util=$(echo "scale=2; $RANDOM/327.67" | bc)
ts=$(echo "$(date -d "-$i minute" +%s) * 1000" | bc)
sql="$sql (’$host’, ‘$idc’, $cpu_util, $memory_util, $disk_util, $ts)"
if [ $i -lt 20 ]; then
sql="$sql,"
fi
done
curl http://localhost:4000/v1/sql -d "sql=$sql"
Go back to Grafana, create a new panel, select your metrics in the query area of your panel and watch the visualization happen!
Grafana Cloud Pro
- $25 / user / month and includes a free trial for new users
- Available with a Grafana Cloud Pro plan
- Access to 1 Enterprise plugin
- Fully managed service (not available to self-manage)
Grafana Cloud Advanced / Grafana Enterprise
- Available with a Grafana Cloud Advanced plan or Grafana Enterprise license
- Access to all Enterprise plugins
- Run fully managed or self-manage on your own infrastructure
Installing GreptimeDB 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.
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 GreptimeDB 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.1.0
Added visual editor, which supports FROM
SELECT
WHERE
0.2.0
Added more features to the visual editor, including GROUP BY
, Aggregate Function
for SELECT
0.2.1
Auto detect time column after table changes. Added detailed error message.
0.2.2
More detailed user guide.
0.2.3
Added a time filter that automatically adds a WHERE
clause to the query depending on the time range selected in the dashboard.
0.2.4
Documentation improvements
Update grafanaDependency to ">=9.0.0" to make this plugin install-able in other grafana version.