Visualize Hydrolix Data in Grafana
You can use Grafana to visualize data stored in your Hydrolix Cluster. The following instructions first create a new instance of Grafana in EC2, then install the Clickhouse plugin to communicate with Hydrolix, then connect Grafana to Hydrolix.
Create Grafana Instance
Already Running Grafana?
If you already have an instance of Grafana running, you can skip this section. However, you should configure your Grafana instance to allow communication with Hydrolix.
First, you'll need a VPC with public access and access to Hydrolix (either through a load balancer or via a public IP).
-
Within that VPC, launch an EC2 instance with the following attributes:
Parameter Setting OS Ubuntu Server 20.04 LTS (HVM), SSD Volume Type
Instance type t2.micro
Subnet Choose "public" and assign a public IP. Security group Default SSH access. Add access to the default Grafana port, 3000
.Access Choose a key pair. Use the default option for all other settings.
-
Click
Launch instance
to create your EC2 instance. -
After you launch your instance, you can connect to it and use it. Once the instance is in the
running
state, connect to it via SSH:ssh <my-instance-url>
-
Update the package list:
sudo apt-get update
Then, upgrade the packages to the latest available version with the built-in package manager
sudo apt-get upgrade
-
Next, we'll install prerequisite software required to install Grafana:
First,
apt-transport-https
:sudo apt-get install apt-transport-https
Second,
software-properties-common
andwget
:sudo apt-get install software-properties-common wget
-
Use
wget
to download Grafana's GPG key:wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
And update the package list again:
sudo apt-get update
-
Finally, install Grafana:
sudo apt-get install grafana
Install Clickhouse Plugin
-
Run the following command to install the Clickhouse plugin required to connect to Hydrolix:
sudo grafana-cli plugins install vertamedia-clickhouse-datasource
-
Before Grafana runs the plugin, you must add it to the
grafana.ini
configuration file. Open the file with administrator permissions:sudo vim /etc/grafana/grafana.ini
Add the following text at the end of the
[plugins]
block:allow_loading_unsigned_plugins=vertamedia-clickhouse-datasource
-
Restart Grafana:
sudo systemctl restart grafana-server
You can verify that Grafana is running with the following command:
sudo systemctl status grafana-server
Connect Grafana to Hydrolix
Admin Access Required
You must have administrator access to your Grafana instance for this step.
Follow the instructions in the Grafana documentation to add a new data source. In the list of available data source types, select the Clickhouse plugin.
In the HTTP section, enter your Hydrolix instance's URL with the path suffix /query/
. For example, if your Hydrolix instance uses the URL https://my.hydrolix.io
, you would enter the following URL: https://my.hydrolix.io/query/
Click Save and Test
to verify the connection.
Add a Dashboard
-
Select the Clickhouse data source you created in the previous section.
-
Configure your query. Replace timestamps with
$from AND $to
.
Updated 29 days ago