Grafana Integration

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:

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

    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:

    allow_loading_unsigned_plugins=vertamedia-clickhouse-datasource
    
  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 to connect to Hydrolix.

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.

  1. Enter a unique name for this Hydrolix cluster connection.
  2. Enter your Hydrolix cluster hostname for the server address.
  3. Enter 9440 for your server port.
  4. Select the Native protocol.
  5. Enter a default database that contains the data you would like to visualize.
  6. Click Save & test to verify the connection.

Add a Dashboard

  1. Select the Clickhouse data source.
  2. Configure your query. Replace timestamps with $from AND $to.