Simple Log Service provides the CloudLens for PolarDB application. The application allows you to manage PolarDB for MySQL clusters in a centralized manner and collect the slow query logs, error logs, audit logs, and metrics of the clusters. This topic describes the features, assets, billing, and limits of CloudLens for PolarDB.
Features
CloudLens for PolarDB provides the following features:
Allows you to manage all PolarDB for MySQL clusters within your Alibaba Cloud account in a centralized manner.
Allows you to enable the data collection feature for the slow query logs, error logs, audit logs, and metrics of PolarDB for MySQL clusters with a few clicks. You can also manage the data collection status of the clusters in a centralized manner.
Allows you to store, query, and analyze the slow query logs, error logs, audit logs, and metrics of PolarDB for MySQL clusters in real time.
Provides various reports.
Assets
Logstore
After you enable the data collection feature for a PolarDB for MySQL cluster in CloudLens for PolarDB, Simple Log Service automatically creates a project whose name is in the aliyun-product-data-<Alibaba Cloud account ID>-<Region ID> format and two Logstores named polardb_audit_log and polardb_log in the region where the cluster resides.
polardb_audit_log: This Logstore is used to store the audit logs of PolarDB for MySQL clusters.
Audit logs are used to review operations and ensure security compliance.
Audit logs help security auditors obtain information such as operator identities and time of data modifications, and identify internal risks such as abuse of permissions and execution of non-compliant commands.
Audit logs help business systems meet audit requirements to ensure security compliance.
polardb_log: This Logstore is used to store the slow query logs and error logs of PolarDB for MySQL clusters.
Slow query logs record the requests whose execution time exceeds a specified threshold. You can use slow query logs to resolve performance issues and optimize requests.
Error logs record information about execution errors in databases. You can use error logs to identify issues.
Metricstore
The first time you enable the data collection feature for metrics, you must select a region. Then, Simple Log Service creates a project whose name is in the aliyun-product-data-<Alibaba Cloud account ID>-<Region ID> format and a Metricstore named polardb_metric in the region.
NoteMetrics are centrally stored. You need to only select a region the first time you enable the data collection feature for metrics. After you enable the data collection feature for metrics of other PolarDB for MySQL clusters, Simple Log Service stores all collected metrics in the Metricstore that is created in the selected region. Example: aliyun-product-data-16****50-cn-hangzhou/polardb_metric.
polardb_metric: This Metricstore is used to store the metrics of PolarDB for MySQL clusters.
PolarDB for MySQL provides various metrics to monitor the running status of PolarDB for MySQL clusters.
Billing
PolarDB for MySQL
After you enable the data collection feature for the audit logs of a PolarDB for MySQL cluster, the SQL Explorer feature is automatically enabled in the cluster. You are charged for the SQL Explorer feature based on the storage space that is occupied by audit logs. For more information, see Billable items.
Simple Log Service
After Simple Log Service collects logs from PolarDB for MySQL, you can transform or ship the logs. You can also read streaming data over the Internet. You are charged for data transformation, data shipping, and read traffic over the Internet. The fees are included in your Simple Log Service bills. For more information, see Billable items of pay-by-feature.
Limits
You can collect only the logs and metrics of PolarDB for MySQL clusters.
The data collection feature for audit logs in CloudLens for PolarDB depends on the SQL Explorer feature of PolarDB for MySQL.
If the SQL Explorer feature is disabled, CloudLens for PolarDB automatically enables the feature.
If you already disabled the data collection feature for the audit logs of a PolarDB for MySQL cluster and want to disable the SQL Explorer feature, you must manually disable the SQL Explorer feature in the PolarDB console. For more information, see Disable the SQL Explorer and Audit feature.
The following table describes the regions in which CloudLens for PolarDB is supported.
Cloud type
Region
Alibaba Cloud public cloud
China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Chengdu), China (Hong Kong), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Japan (Tokyo), US (Silicon Valley), US (Virginia), Germany (Frankfurt), UK (London).
Precautions
To use a CloudLens application, make sure that at least one project exists within your Alibaba Cloud account.
When you enable a CloudLens application, Simple Log Service automatically checks whether a project exists within your Alibaba Cloud account.
Check logic
The first time you enable a CloudLens application, Simple Log Service automatically checks whether a project exists within your Alibaba Cloud account. If no projects exist, Simple Log Service creates a project whose name is in the
aliyun-product-data-<Alibaba Cloud account ID>-cn-heyuan
format in the China (Heyuan) region.After you enable a CloudLens application, Simple Log Service automatically checks whether a project exists within your Alibaba Cloud account. If no projects exist, Simple Log Service does not create a project in the China (Heyuan) region. You can manually create a project. For more information about how to create a project, see Manage a project.
Delete a project
If you want to delete the project whose name is in the
aliyun-product-data-<Alibaba Cloud account ID>-cn-heyuan
format, open Cloud Shell and run the following command. Replace Alibaba Cloud account ID based on your business scenario.aliyunlog log delete_project --project_name=aliyun-product-data-<Alibaba Cloud account ID>-cn-heyuan --region-endpoint=cn-heyuan.log.aliyuncs.com
If you want to delete other projects and Logstores, follow the instructions provided in Manage a Logstore and Manage a project.