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.
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
Credentials should be updated as soon as the service is created.
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.
- 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:
|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,
|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
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:
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)