Using Grafana with Hydrolix

Hydrolix is bundled with a Grafana instance for ease of use. The following provides instructions to either use the built-in version or configure your own external Grafana instance.

Built-in Grafana

With all Hydrolix deployments a Grafana instance is automatically provided. This instance can be scaled to 0 at any time using the hdxctl scale command.

Once activated you can connect to the service at the /grafana url endpoint, and log in with the default passwords of admin admin user/password.

Credentials should be updated as soon as the service is created.

Grafana Data Source

Then go to add new data source on the lefthand bar and scroll to the bottom, add a clickhouse source at your query url.

Then you can set up dashboard with it!

Build your own 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.

  1. Launch EC2 instance
  2. Install Grafana and driver
  3. Run Grafana as a service
  4. Connect to Hydrolix
  5. 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.

Grafana Instance Security Group

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 - | sudo apt-key add -
echo "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:


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.

Grafana Data Source

Under HTTP Configuration:

URL: https://<your Hydrolix system>/query/, for example,

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)

Create Dashboard