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).

  1. Within that VPC, launch an EC2 instance with the following attributes:

    OSUbuntu Server 20.04 LTS (HVM), SSD Volume Type
    Instance typet2.micro
    SubnetChoose "public" and assign a public IP.
    Security groupDefault SSH access. Add access to the default Grafana port, 3000.
    AccessChoose a key pair.

    Use the default option for all other settings.

  2. Click Launch instance to create your EC2 instance.

    Grafana Instance Security Group

  3. 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>
  4. 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
  5. 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 and wget:

    sudo apt-get install software-properties-common wget
  6. Use wget to download Grafana's GPG key:

    wget -q -O - | sudo apt-key add -
    echo "deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

    And update the package list again:

    sudo apt-get update
  7. Finally, install Grafana:

    sudo apt-get install grafana

Install Clickhouse Plugin

  1. Run the following command to install the Clickhouse plugin required to connect to Hydrolix:

    sudo grafana-cli plugins install vertamedia-clickhouse-datasource
  2. 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:

  3. 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.

Grafana Data Source

In the HTTP section, enter your Hydrolix instance's URL with the path suffix /query/. For example, if your Hydrolix instance uses the URL, you would enter the following URL:

Click Save and Test to verify the connection.

Add a Dashboard

  1. Select the Clickhouse data source you created in the previous section.

  2. Configure your query. Replace timestamps with $from AND $to.

    Create Dashboard