Visualize ClickHouse® data with Grafana®
You can visualise your ClickHouse® data using Grafana® and Exoscale can help you connect the two services.
Prerequisites
- 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.
- Managed ClickHouse® service accessible by HTTPS
- Managed Grafana service (see how to get started with Managed Grafana)
Variables
You'll need a few variables for the setup.
| Variable | Description |
|---|---|
CLICKHOUSE_HOST | Hostname of your ClickHouse service. |
CLICKHOUSE_NATIVE_PORT | Port of the native protocol endpoint, read from the clickhouse component. |
CLICKHOUSE_HTTPS_URI | HTTPS service URI of your ClickHouse service, in the form https://CLICKHOUSE_HOST:PORT, where PORT is read from the clickhouse_https component. |
CLICKHOUSE_USER | Username to access ClickHouse service. |
CLICKHOUSE_PASSWORD | Password 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-2Integrate 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
- Log in to your Managed Grafana® service.
- From the left menu, select Connections > Data sources > Add new data source.
- Find ClickHouse in the list and select it.
- Set Server address to
CLICKHOUSE_HOSTand Server port toCLICKHOUSE_NATIVE_PORT. - Enable Secure connection, and set the protocol to Native.
- Set your
CLICKHOUSE_USERandCLICKHOUSE_PASSWORDin the credentials fields. - Select Save & test. Grafana reports that the data source is working.
With the Altinity plugin
- From the left menu, select Connections > Data sources > Add new data source.
- Find Altinity plugin for ClickHouse in the list and select it.
- Set URL to
CLICKHOUSE_HTTPS_URI. - In Auth section, enable Basic auth and With Credentials.
- In Basic Auth Details, set your
CLICKHOUSE_USERandCLICKHOUSE_PASSWORD. - Select Save & test.
Now you can create a dashboard and panels to work with the data from your Managed ClickHouse® service.