Visualize Hydrolix Data in Grafana

You can use Grafana to visualize data stored in your Hydrolix Cluster. This guide shows how to create a new instance of Grafana in EC2, install the ClickHouse plugin to communicate with Hydrolix, and connect Grafana to Hydrolix.

Prerequisites

  • A VPC with public access and access to the Hydrolix instance, either through a load balancer or using a public IP address

Create Grafana instance

📘

Already Running Grafana?

Already have an instance of Grafana running? Skip this section, but configure your Grafana instance to allow communication with Hydrolix. Verify that you have administrator access to the instance.

Create an EC2 instance

  1. In a VPC, launch an EC2 instance with the following attributes:

    ParameterSetting
    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 the EC2 instance.

Connect to instance and upgrade

  1. Connect to the instance after launching it. Once the instance is in the running state, connect to it with SSH.

    ssh <my-instance-url>
    
  2. Update the package list.

    sudo apt-get update
    

1.Upgrade the packages to the latest available version with the built-in package manager.

   sudo apt-get upgrade

Set up Grafana prerequisites

  1. Install apt-transport-https.

    sudo apt-get install apt-transport-https
    
  2. Install software-properties-common and wget.

    sudo apt-get install software-properties-common wget
    
  3. Use wget to download the Grafana 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
    
  4. Update the package list again.

sudo apt-get update

Install Grafana

  1. Install Grafana.

    sudo apt-get install grafana
    

Install ClickHouse plugin

  1. Install the ClickHouse plugin to connect to Hydrolix.

    sudo grafana-cli plugins install vertamedia-clickhouse-datasource
    
  2. Add the plugin to the grafana.ini configuration file before Grafana runs. Open the file with administrator permissions.

    sudo vim /etc/grafana/grafana.ini
    
  3. Add this text at the end of the [plugins] block:

    allow_loading_unsigned_plugins=vertamedia-clickhouse-datasource
    
  4. Restart Grafana.

    sudo systemctl restart grafana-server
    
  5. Verify that Grafana is running.

    sudo systemctl status grafana-server
    

Connect Grafana to Hydrolix

📘

Admin Access Required

You must have administrator access to your Grafana instance for this step.

  1. Follow the instructions in the Grafana documentation to add a new data source.

  2. From the list of available data source types, select the ClickHouse plugin.

  3. In the HTTP section, enter the Hydrolix instance URL with the path suffix /query/. For example, if the Hydrolix instance uses the URL https://my.hydrolix.io, enter the following URL: https://my.hydrolix.io/query/

  4. Click Save and Test to verify the connection.

Add a dashboard

  1. Select the ClickHouse data source created in the previous section.

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

    Create Dashboard