Detects SQL patterns with abnormal execution metrics within a specified time range.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:DescribeAbnormalPatternDetection |
get |
DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The cluster ID. Note
You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs. |
am-xxxx |
| RegionId |
string |
Yes |
The region ID. Note
You can call the DescribeRegions operation to query the most recent region list. |
cn-shenzhen |
| StartTime |
string |
No |
The start of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. |
2011-06-01T16:00Z |
| EndTime |
string |
No |
The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. |
2021-05-18T06:30Z |
| Lang |
string |
No |
The language. Valid values:
|
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| TotalCount |
string |
The total number of entries returned. |
300 |
| RequestId |
string |
The request ID. |
36B66482-A215-5F04-A42E-859983D89D7B |
| DBClusterId |
string |
The cluster ID. |
am-xxxx |
| DetectionItems |
array<object> |
The detection items and their results. |
|
|
array<object> |
A single detection item and its result. |
||
| Name |
string |
The name of the detection item. |
Cost,PeakMemory |
| Results |
array<object> |
The detection result. |
|
|
object |
A single detection result entry. |
||
| PatternId |
string |
The SQL pattern ID. |
5495577090378760322 |
| SQLPattern |
string |
The representative SQL statement of the pattern. |
SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ? |
| Detail |
string |
The detection report details for the SQL pattern. |
{} |
| RelatedMetrics |
string |
The metrics related to the SQL pattern. |
Maximum query time:1.43s Maximum peak memory:20.73MB Maximum table read data volume:10.12MB |
| User |
string |
The name of the database account that is used to submit the query. |
test |
| AccessIp |
string |
The IP address of the SQL client that submits the SQL pattern. |
11.81.238.102 |
| Tables |
string |
The names of tables. |
ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report |
| QueryCount |
integer |
The number of executed SQL patterns within the time range. |
72 |
| FailedCount |
integer |
The number of failed SQL patterns within the time range. |
63 |
| Status |
string |
The severity level of the detection result. Valid values:
|
NORMAL WARNNING CRITICAL |
| Message |
string |
The description of the detection result. |
Detected 2 totalTime metric anomaly patterns that may cause increased CPU usage or slower queries and affect system stability. Go to the monitoring page to use the one-click diagnosis feature to view details and optimize. |
Examples
Success response
JSON format
{
"TotalCount": "300",
"RequestId": "36B66482-A215-5F04-A42E-859983D89D7B",
"DBClusterId": "am-xxxx",
"DetectionItems": [
{
"Name": "Cost,PeakMemory",
"Results": [
{
"PatternId": "5495577090378760322",
"SQLPattern": "SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?",
"Detail": "{}",
"RelatedMetrics": "Maximum query time:1.43s\nMaximum peak memory:20.73MB\nMaximum table read data volume:10.12MB",
"User": "test",
"AccessIp": "11.81.238.102",
"Tables": "ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report",
"QueryCount": 72,
"FailedCount": 63
}
],
"Status": "NORMAL\nWARNNING\nCRITICAL",
"Message": "Detected 2 totalTime metric anomaly patterns that may cause increased CPU usage or slower queries and affect system stability. Go to the monitoring page to use the one-click diagnosis feature to view details and optimize."
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The specified DBClusterId parameter does not exist. Make sure that the DBClusterId value is valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.