Add and use AnalyticDB for PostgreSQL
This topic describes how to connect AnalyticDB for PostgreSQL to Grafana to visualize your data.
Prerequisites
You have purchased AnalyticDB for PostgreSQL and populated it with data. For more information, see Product overview.
You have created a Grafana workspace. You can quickly create a Grafana workspace on Alibaba Cloud. For more information, see Quick start with Managed Service for Grafana.
Procedure
-
Log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.
On the Workspace management page, copy the Public IP address or Private IP address of your Grafana workspace and add it to the whitelist of your AnalyticDB for PostgreSQL instance. This allows Grafana to access the AnalyticDB for PostgreSQL instance. For more information, see Configure a whitelist. This example uses a public connection.
On the Workspace management page, click the Public endpoint to open Grafana.
NoteLog on to Grafana using the Admin account and the password that you set when you created the workspace.
In the left-side navigation pane of Grafana, click the
icon, then select Data source.On the page that appears, click Add data source and select PostgreSQL. Configure the following parameters.
Parameter
Description
Name
The name of the data source.
Network type
The network type.
Host
The endpoint of the AnalyticDB for PostgreSQL instance, in the format
<host>:<port>, for example,gp-bp10vkbe1x1v3h****-master.gpdb.rds.aliyuncs.com:5432.Database
The name of the AnalyticDB for PostgreSQL database.
User
The database user for AnalyticDB for PostgreSQL.
Password
The password for the AnalyticDB for PostgreSQL database user.
TLS/SSL mode
Select disable. You can also configure this parameter based on your requirements.
Version
Select PostgreSQL 9.4.
More parameters
For descriptions of other parameters, see the official Grafana documentation.
At the bottom of the page, click Save & test.
If the message
Database Connection OKappears, the connection is successful.You can analyze data in Grafana. For more information about data analysis, see the official Grafana documentation.