Grafana Integration
As an example to integrating Grafana, these instructions will lead you through setting up an EC2 instance to use with Grafana and configuring Grafana to work with Hydrolix. It is a bare minimum configuration and is not meant for production. For information on how to install Grafana in a reliable way, refer to their documentation.
- Launch EC2 instance
- Install Grafana and driver
- Run Grafana as a service
- Connect to Hydrolix
- Validate connection
Launching an EC2 instance for Grafana
In a VPC with public access, and access to Hydrolix, launch and EC2 instance that has the following attributes:
Parameter | Setting |
---|---|
OS | Ubuntu Server 20.04 LTS (HVM), SSD Volume Type |
Instance type | t2.micro |
Subnet | Needs connectivity to Hydrolix VPC. It needs a public route out, either through a load balancer, or by having a public IP. For this example, we will choose a public subnet, and assign a public IP |
Security group | Leave the default SSH access, and add access to the default Grafana port, 3000 |
Access | Choose a key pair |
All other settings should be left as default.
Once the instance has started, SSH to it and run the following prerequisite steps:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apt-transport-https
sudo apt-get install software-properties-common wget
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
sudo apt-get update
These steps add the required underlying components required by Grafana, and adds Grafana to apt-get so it can be installed.
Install Grafana and Driver
To install Grafana, execute the following steps:
sudo apt-get install grafana
sudo grafana-cli plugins install vertamedia-clickhouse-datasource
The vertamedia plugin will need to be allowed in the grafana.ini file.
sudo vi /etc/grafana/grafana.ini
Update [plugins]
with:
allow_loading_unsigned_plugins=vertamedia-clickhouse-datasource
Restart grafana and verify it is running:
sudo systemctl restart grafana-server
sudo systemctl status grafana-server
Configure the Data Source
Login into Grafana and add new data source. The Clickhouse plugin will show up in the list of available connection types.
Under HTTP Configuration:
URL: https://<your Hydrolix system>/query/
, for example, https://me.hydrol9.com/query/
Click Save and Test to verify.
Add a Dashboard
- Select your Clickhouse Data Source
- Setup your query but replace your timestamps with ($from AND $to)
- Timestamps variables are set up at the top (red box)
Updated 8 months ago