Configure a Tencent Cloud External Collection Source
Tencent Cloud external collection sources are used to collect slow logs from Tencent Cloud managed databases. The current support scope includes Tencent Cloud RDS MySQL, Tencent Cloud RDS PostgreSQL, and Tencent Cloud TDSQL.
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.
- Tencent Cloud access credentials have already been configured in NineData. For more information, see Configure Cloud Vendor Access Credentials.
- The target Tencent Cloud data source has already been added. It is recommended to create or bind the instance through the Tencent Cloud entry.
- You have confirmed the target instance region, instance ID, and any cluster or instance identifiers required by the page for TDSQL scenarios.
- Slow logging is enabled on the target instance, and the cloud account has permission to view the target instance and read slow logs.
Permission Requirements
If you use a Tencent Cloud custom policy, make sure it includes query permissions for the target database instance and slow log read permissions. Permission Action names vary by Tencent Cloud database product, so use the names shown in the Tencent Cloud console.
Instance-view permissions alone may not be enough to read slow logs. When you create or update a policy, include permissions for instance lists, instance details, and slow log queries.
Step 1: Create a Tencent Cloud External Collection Source
Log in to the NineData Console.
In the left navigation pane, click DevOps > Slow Query.
On the top tab bar, click External Collection Source.
Click Create External Collection Source, then complete the following configuration in the drawer.
Parameter Description Source Type Select Tencent Cloud. Cloud Access Credential Select the configured Tencent Cloud access credential. Source Name Enter a custom source name. Description Optional. Enter a description for this source. Click OK to create the source.
Step 2: Bind the Source and Enable Collection
Return to the Slow Query tab, find the target Tencent Cloud data source, and turn on the switch in the Slow Query column.
In the dialog, select External Source Collection, then complete the following configuration.
Parameter Description External Collection Source Select the Tencent Cloud external collection source you created. Source Data Source Unique Identifier Enter Tencent Cloud instance identifiers as required by the page. They usually include RegionIdandInstanceId. For TDSQL scenarios, also enter the cluster or instance identifiers required by the page.Collection Frequency Select the slow log collection frequency. Enter Tencent Cloud instance identifiers.
Key Description RegionIdTencent Cloud region ID, for example ap-shanghai.InstanceIdTencent Cloud database instance ID. tipIf the key names shown in the console are different, use the page requirements and the actual instance information in the Tencent Cloud console.
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.
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
| Symptom | Recommended Check |
|---|---|
| Cloud access credential not found | Create Tencent Cloud access credentials in NineData first. |
| Region parameter is missing | Fill in RegionId and make sure it matches the target instance. |
| Instance ID is missing | Fill in InstanceId and make sure it matches the Tencent Cloud console. |
| Collection result is empty | Make sure slow logging is enabled on the target instance and slow queries were generated within the selected time range. |
| Cloud vendor client connection failed | Check whether the data source was created through the Tencent Cloud entry. If not, confirm the connection method, region, and instance identifiers. |