Skip to content
Visualize ClickHouse® data with Grafana®

Visualize ClickHouse® data with Grafana®

You can visualise your ClickHouse® data using Grafana® and Exoscale can help you connect the two services.

Prerequisites

  1. Exoscale CLI version 1.97 or later. Earlier releases expose no ClickHouse commands at all, and the commands on this page fail as unknown commands.
  2. Managed ClickHouse® service accessible by HTTPS
  3. Managed Grafana service (see how to get started with Managed Grafana)

Variables

You'll need a few variables for the setup.

VariableDescription
CLICKHOUSE_HOSTHostname of your ClickHouse service.
CLICKHOUSE_NATIVE_PORTPort of the native protocol endpoint, read from the clickhouse component.
CLICKHOUSE_HTTPS_URIHTTPS service URI of your ClickHouse service, in the form https://CLICKHOUSE_HOST:PORT, where PORT is read from the clickhouse_https component.
CLICKHOUSE_USERUsername to access ClickHouse service.
CLICKHOUSE_PASSWORDPassword to access ClickHouse service.

Read the host and the ports from the service components: the native protocol port from the clickhouse entry, and the HTTPS port from the clickhouse_https entry. Ports are assigned per service, so read them from your own service rather than reusing a value from an example:

exo x get-dbaas-service-clickhouse my-clickhouse -z ch-gva-2 -q 'components'

Retrieve the password of the avnadmin user:

exo x reveal-dbaas-clickhouse-user-password my-clickhouse avnadmin -z ch-gva-2

Integrate ClickHouse® with Grafana®

Managed Grafana ships with two ClickHouse data source plugins: the official ClickHouse plugin by Grafana Labs, and the Altinity plugin for ClickHouse. Both work with Managed ClickHouse®.

With the official ClickHouse plugin

  1. Log in to your Managed Grafana® service.
  2. From the left menu, select Connections > Data sources > Add new data source.
  3. Find ClickHouse in the list and select it.
  4. Set Server address to CLICKHOUSE_HOST and Server port to CLICKHOUSE_NATIVE_PORT.
  5. Enable Secure connection, and set the protocol to Native.
  6. Set your CLICKHOUSE_USER and CLICKHOUSE_PASSWORD in the credentials fields.
  7. Select Save & test. Grafana reports that the data source is working.

With the Altinity plugin

  1. From the left menu, select Connections > Data sources > Add new data source.
  2. Find Altinity plugin for ClickHouse in the list and select it.
  3. Set URL to CLICKHOUSE_HTTPS_URI.
  4. In Auth section, enable Basic auth and With Credentials.
  5. In Basic Auth Details, set your CLICKHOUSE_USER and CLICKHOUSE_PASSWORD.
  6. Select Save & test.

Now you can create a dashboard and panels to work with the data from your Managed ClickHouse® service.

Last updated on