Grafana Manual Installation

Use Grafana to visualize data stored in your Hydrolix cluster.

Use this page to create a new instance of Grafana in EC2, install the Hydrolix data source plugin, then connect Grafana to a Hydrolix cluster using the plugin,

You can also use the built-in Grafana in your Hydrolix cluster. See Grafana Automatic Installation.

Create a Grafana instance

📘

Already running Grafana?

If you already have an instance of Grafana running, be sure to install and configure the Hydrolix data source plugin to communicate with a Hydrolix cluster.

Prerequisites

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

  • Grafana administrator role access, added during instance creation

  • Install apt-transport-https

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

    sudo apt-get install software-properties-common wget
    

Create an EC2 instance

  1. In the 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.

    Grafana Instance Security Group

  3. Once the instance is in the running state, connect to it with SSH.

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

    sudo apt-get update
    
  5. Upgrade the packages to the latest available version with the built-in package manager.

    sudo apt-get upgrade
    
  6. 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
    
  7. Update the package list again.

    sudo apt-get update
    
  8. Install Grafana.

    sudo apt-get install grafana
    

Install the Hydrolix data source plugin

Use the plugin catalog.
To install the plugin using automation, or to install a specific version, use the Grafana CLI.

See more methods of installation in install a plugin.

Use the plugin catalog

To install the Hydrolix data source plugin:

  1. Open the plugin catalog in your Grafana instance (https://{grafana-url}/plugins).
  2. Search for Hydrolix Data Source.
  3. Select the plugin and click Install Plugin.

For more details about installation, see Grafana’s Plugin management documentation.

Use the Grafana CLI

  1. Install the Hydrolix data source plugin:

    sudo grafana cli plugins install hydrolix-hydrolix-datasource
    
    ✔ Downloaded and extracted hydrolix-hydrolix-datasource v0.6.0 zip successfully to /var/lib/grafana/plugins/hydrolix-hydrolix-datasource
    
    Restart Grafana after installing or removing plugins. Refer to Grafana documentation for instructions if necessary.
    
  2. 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.

  1. In Grafana, go to Connections > Data Sources > + Add new data source.
  2. Select Hydrolix from the list.

Now configure the data source:

  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. Enable the Secure Connection toggle if your Hydrolix cluster has TLS enabled.
  6. Credentials can be provided in the form of user account (user/pass) or service account (token). If you're using a service account, you can generate a token using the UI instructions or the API instructions.
  7. Click Save & test to verify the connection.

Add a Dashboard

  1. Select New > New dashboard.

  2. Select + Add visualization.

  3. Select Hydrolix - Local from the data source dropdown.

  4. Paste the following query into the query input box:

    SELECT
    count(*) as error_count,
    toStartOfMinute(timestamp) AS minute,
    container
    FROM
    hydro.logs
    WHERE
    timestamp > NOW() - INTERVAL 1 DAY
    AND level = 'error'
    GROUP BY
    minute, container
    ORDER BY 
    minute ASC
    
  5. Change Query Type to TimeSeries

  6. In the right-hand panel, change No value to 0.

You should now have a timeseries visualization showing the count of errors by container for your Hydrolix cluster.

Hydrolix cluster error count by container

  1. Select Save dashboard to save this visualization in a new dashboard.