Skip to main content

Configure an Alibaba Cloud External Collection Source

Alibaba Cloud external collection sources are used to collect slow logs from Alibaba Cloud managed databases. The current support scope includes Alibaba Cloud RDS MySQL, RDS PostgreSQL, PolarDB for MySQL, and PolarDB for PostgreSQL.

Prerequisites

  • You have created or joined an organization, and this organization has subscribed to either DevOps Pro or DevOps Enterprise. Please ensure that your annual or monthly subscription is still active. For more information, please refer to Manage Organizations.
  • Your current account has switched to the target organization. For more information, please refer to Switching to an Organization.
  • Alibaba Cloud access credentials have already been configured in NineData. For more information, see Configure Cloud Vendor Access Credentials.
  • The target Alibaba Cloud data source has already been added. It is recommended to create or bind the instance through the Alibaba Cloud entry.
  • You have confirmed the target instance or cluster region and the instance ID or cluster ID.
  • Slow logging is enabled on the target instance, and the cloud account has read-only access to the target instance or cluster and SQL log archive/export permissions.

Permission Requirements

Grant the following system policy to the Alibaba Cloud RAM user, user group, or role according to the instance type.

Instance TypeMinimum System Policy
RDSAliyunRDSReadOnlyWithSQLLogArchiveAccess
PolarDBAliyunPolardbReadOnlyWithSQLLogArchiveAccess
tip

RDS or PolarDB read-only policies alone may not allow SQL log archive data to be read. If you use a custom RAM policy, make sure it covers the corresponding product's read-only permissions and SQL log archive/export permissions.

Step 1: Create an Alibaba Cloud External Collection Source

  1. Log in to the NineData Console.

  2. In the left navigation pane, click DevOps > Slow Query.

  3. On the top tab bar, click External Collection Source.

  4. Click Create External Collection Source, then complete the following configuration in the drawer.

    ParameterDescription
    Source TypeSelect Alibaba Cloud.
    Cloud Access CredentialSelect the configured Alibaba Cloud access credential.
    Source NameEnter a custom source name.
    DescriptionOptional. Enter a description for this source.
  5. Click OK to create the source.

Step 2: Bind the Source and Enable Collection

  1. Return to the Slow Query tab, find the target Alibaba Cloud data source, and turn on the switch in the Slow Query column.

  2. In the dialog, select External Source Collection, then complete the following configuration.

    ParameterDescription
    External Collection SourceSelect the Alibaba Cloud external collection source you created.
    Source Data Source Unique IdentifierEnter key-value pairs based on the instance type. RDS instances usually use DBInstanceId and RegionId; PolarDB clusters usually use DBClusterId and RegionId.
    Collection FrequencySelect the slow log collection frequency.
  3. Enter identifiers based on the instance type.

    Instance TypeKeyDescription
    RDSDBInstanceIdAlibaba Cloud RDS instance ID.
    RDSRegionIdAlibaba Cloud region ID, for example cn-hangzhou.
    PolarDBDBClusterIdAlibaba Cloud PolarDB cluster ID.
    PolarDBRegionIdAlibaba Cloud region ID, for example cn-hangzhou.
  4. Click OK to enable collection.

Step 3: Confirm Collection Results

Wait for at least one collection cycle, then open the Slow Query Details page of the target data source. Adjust the time range and check the slow log list, Top SQL, and trend chart to confirm whether slow log records have been written to NineData.

tip

The slow query detail page displays records from a maximum time range of 3 days. If the target instance has no new slow logs, the query result is empty.

FAQ

SymptomRecommended Check
Cloud access credential not foundCreate Alibaba Cloud access credentials in NineData first.
Region parameter is missingFill in RegionId and make sure it matches the target instance or cluster.
Instance ID or cluster ID is missingUse DBInstanceId for RDS and DBClusterId for PolarDB.
Cloud vendor client connection failedCheck whether the data source was created through the Alibaba Cloud entry. If not, confirm that the connection method, region, and identifier match the Alibaba Cloud console.
Collection result is emptyMake sure slow logging is enabled on the target instance and slow queries were generated within the selected time range.