Configuring Grafana to Connect to DLI for Data Query and Analysis
Grafana is an open-source data visualization platform. Using Grafana's rich chart types, you can centrally display and analyze data stored in DLI.
This section describes the steps to connect Grafana to DLI.
Preparations
- Environment requirements:
Ensure your system environment meets the following requirements:
- Toolkits:
- DLI's Grafana driver: dli-grafana
- Grafana installation package:
Download Grafana at its official website.
Select the Grafana version appropriate for your operating system. Version later than 11.0.0 is recommended.
Download and extract the Grafana package, and complete installation by following the official documentation.
- Connection information:
Table 1 Connection information Item
Description
How to Obtain
DLI's AK/SK
AK/SK-based authentication uses an AK/SK pair to sign requests for identity authentication.
DLI endpoint address
Endpoint of a cloud service in a region.
DLI project ID
Project ID used for resource isolation.
DLI region information
Region to which DLI belongs.
Step 1: Install the dli-grafana Driver in Grafana
- Obtain the dli-grafana plug-in from the DLI console.
- Save all files from the dist directory of the downloaded and extracted dli-grafana plugin to the data/plugins/dli-datasource folder under the Grafana installation directory (create this folder manually if it does not exist).
- In the conf/defaults.ini file under the Grafana installation directory, set the following parameter to allow loading unsigned drivers:
allow_loading_unsigned_plugins = dli-datasource
- Restart the Grafana service to load the dli-grafana driver.
Step 2: Access Grafana
- Access Grafana using a browser with default port 3000.
IP address of the host where Grafana is installed:Port Example: http://127.x.x.x:3000
- Enter the Grafana administrator username and password.
Step 3: Configure Grafana to Connect to DLI
- In the Grafana side menu, click Data Sources.
- Click Add data source and select dli-datasource as the data source type.
Set parameters based on Figure 1.
Table 2 Grafana-to-DLI parameter description Parameter
Mandatory
Description
Example Value
Region
Yes
Region name.
ap-southeast-2
Project Id
Yes
Project ID where DLI resources are located.
0b33ea2a7e0010802fe4c009bb05076d
Catalog Name
Yes
Metadata catalog name.
No
For example, if using a LakeFormation catalog named lfcatalog, the configuration is as follows: catalog=lfcatalog.
Database Name
Yes
DLI database name used to submit jobs.
tpch
Queue Name
Yes
DLI queue name.
dli_test
Engine Type
Yes
Type of the DLI queue.
You can select spark.
spark
AK and SK
Yes
AK/SK credentials.
-
- Click Save & Test to verify if the connection is successful.
Step 4: Create a Dashboard and Submit SQL Queries
- On the Grafana home page, click + New to create a dashboard.
- Add a new panel and select a chart type for your data.
- In the panel settings, select the configured dli-datasource as the data source.
- Enter your SQL query, preview the results, and adjust the chart settings as needed.
- Save the panel and dashboard. You can then use this dashboard to monitor and analyze data in DLI. Figure 2 Submitting SQL queries in the dashboard
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
