Blog

Dashboard Your Data in Databend Cloud with Grafana

everpcpcMar 17, 2023

Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. With Grafana, you can create, explore, and share beautiful dashboards with your team and foster a data driven culture.

Databend Cloud offers integration with Grafana. In this post, I will demonstrate how to create a dashboard for your data in Databend Cloud using Grafana, using the Anonymized Web Analytics dataset (hits_v1) from ClickBench as an example. Databend Cloud provides this dataset as a data loading sample out-of-the-box. To load the data into Databend Cloud, you can click Load Data after logging in, and then select Anonymized Web Analytics Data.TSV (7.5G) from the available datasets.

Before integrating, you need to refer to the Grafana Install Guide and set up an instance of Grafana in your environment.

Step 1. Install Databend Data Source Plugin

Follow the Tutorial: Integrating with Grafana to install the Databend Data Source Plugin.

Step 2. Create Data Source

  1. On the sidebar of the Grafana homepage, click the gear button, and then select Data sources.
  2. On the Data sources tab, select Add new data source.
  3. Search for and select the data source type
    Altinity plugin for ClickHouse
    .
  4. Configure the data source. To obtain the URL and SQL account information for the Databend Cloud warehosue, refer to https://docs.databend.com/using-databend-cloud/warehouses/connecting-a-warehouse
SettingDescription
URLThe host address of the Databend Cloud warehouse, for example:
https://tnf34b0rm--small-book.ch.aliyun-cn-beijing.default.databend.com
. Please note that the address should start with
https://
.
AccessSelect “Server (default)”.
AuthSelect "Basic auth".
User/PasswordAfter selecting "Basic auth", please fill in the SQL username and password for connecting to the warehouse in the Basic Auth Details.
AdditonalSelect "Add CORS flag to requests".
  1. Click Save & test. If the page displays
    Data source is working
    , it means that the data source has been successfully created.

Step 3. Create Dashboard

  1. Click the Dashboards button in the sidebar on the Grafana homepage, and then select New Dashboard > New Panel.
  2. Select the data source created in Step 2, and then select the
    default
    database and
    hits_100m_obfuscated_v1
    table in order after FROM.

Alt text

  1. Click Go to Query, then copy and paste the following SQL statements:
SELECT
eventtime as t,
count()
FROM $table
GROUP BY t
ORDER BY t
  1. After a short moment, the view will appear at the top of the page. Then click Save in the upper right corner.

Alt text

Share this post

Subscribe to our newsletter

Stay informed on feature releases, product roadmap, support, and cloud offerings!