Add and use AnalyticDB for PostgreSQL

Updated at:

This topic describes how to connect AnalyticDB for PostgreSQL to Grafana to visualize your data.

Prerequisites

Procedure

  1. Log on to the Managed Service for Grafana console. In the left-side navigation pane, click Workspace Management.

  2. 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.

  3. On the Workspace management page, click the Public endpoint to open Grafana.

    Note

    Log on to Grafana using the Admin account and the password that you set when you created the workspace.

  4. In the left-side navigation pane of Grafana, click the p336428..png icon, then select Data source.

  5. 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.

  6. At the bottom of the page, click Save & test.

    If the message Database Connection OK appears, the connection is successful.

  7. You can analyze data in Grafana. For more information about data analysis, see the official Grafana documentation.