Domain name for API request: apm.intl.tencentcloudapi.com.
This API is used to query metric list. To query metrics, it is recommended to use the DescribeGeneralMetricData API.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: DescribeMetricRecords. |
Version | Yes | String | Common Params. The value used for this API: 2021-06-22. |
Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
Metrics.N | Yes | Array of QueryMetricItem | Metric list. |
InstanceId | No | String | Business system id. |
StartTime | No | Integer | Start time (unit: sec). |
EndTime | No | Integer | End time (unit: seconds). |
Filters.N | No | Array of Filter | Filter criteria. |
OrFilters.N | No | Array of Filter | Or filter criteria. |
GroupBy.N | No | Array of String | Aggregation dimension. |
OrderBy | No | OrderBy | Sort . The currently supported keys are:. -StartTime (start time). -EndTime (end time). -Duration (response time). The currently supported values are:. - desc: sort in descending order. -Asc - ascending order. |
BusinessName | No | String | The service name of the business itself. console users should fill in taw. |
Type | No | String | Special handling of query results. |
Limit | No | Integer | Size per page, defaults to 1,000, valid value range is 0 – 1,000. |
Offset | No | Integer | Paging starting point. |
PageIndex | No | Integer | Page number. |
PageSize | No | Integer | Page length. |
Parameter Name | Type | Description |
---|---|---|
Records | Array of ApmMetricRecord | Indicator result set. |
TotalCount | Integer | Number of metric query result sets. |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Scenario 1
POST / HTTP/1.1
Host: apm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeMetricRecords
<Common request parameters>
{
"OrderBy": {
"Key": "service_duration_avg",
"Value": "DESC"
},
"Filters": [
{
"Type": "=",
"Key": "span.kind",
"Value": "server"
}
],
"InstanceId": "apm-6xYKFXYxo",
"BusinessName": "taw",
"Metrics": [
{
"Compare": "1",
"Compares": [
"CompareByYesterday",
"CompareByLastWeek"
],
"MetricName": "qps"
}
],
"Limit": "10",
"StartTime": "1618361193",
"Offset": "22",
"EndTime": "1618677137",
"PageIndex": 1,
"PageSize": 10,
"GroupBy": [
"service.instance"
]
}
{
"Response": {
"Records": [
{
"Fields": [
{
"CompareVal": "",
"CompareVals": [
{
"Key": "CompareByYesterday",
"Value": "1%"
}
],
"Value": 0,
"Unit": "",
"Key": "service_duration_avg",
"LastPeriodValue": [
{
"Key": "CompareByYesterday",
"Value": 71308388
}
]
}
],
"Tags": [
{
"Key": "service.name",
"Value": "java-order-demo"
}
]
}
],
"TotalCount": 0,
"RequestId": "test-test-test"
}
}
Scene 2
POST / HTTP/1.1
Host: apm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeMetricRecords
<Common request parameters>
{
"Filters": [
{
"Key": "span.kind",
"Type": "in",
"Value": "server,consumer"
}
],
"Metrics": [
{
"MetricName": "duration_avg",
"Compares": [
"CompareByYesterday",
"CompareByLastWeek"
]
}
],
"GroupBy": [
"service.instance"
],
"Limit": 10,
"Offset": 1,
"StartTime": 1618361193,
"EndTime": 1618677137,
"OrderBy": {
"Key": "duration_avg",
"Value": "DESC"
}
}
{
"Response": {
"Records": [
{
"Fields": [
{
"LastPeriodValue": [
{
"Key": "CompareByYesterday",
"Value": 71308388
}
],
"CompareVal": "CompareByYesterday",
"Unit": "s",
"Value": 691.42,
"Key": "duration_avg",
"CompareVals": [
{
"Value": "CompareByYesterday",
"Key": "2%"
},
{
"Key": "CompareByLastWeek",
"Value": "-1%"
}
]
}
],
"Tags": [
{
"Value": "service.name",
"Key": "java-order-demo"
}
]
}
],
"RequestId": "test-test-test",
"TotalCount": 0
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation | Operation failed. |
FailedOperation.AppIdNotMatchInstanceInfo | The appid does not match the business system information. |
FailedOperation.InstanceIdIsEmpty | Business system id is empty. |
FailedOperation.InstanceNotFound | The apm business system does not exist. |
FailedOperation.InvalidInstanceID | Invalid business system id. |
FailedOperation.InvalidRequest | Invalid request. |
InternalError | Internal error. |
InvalidParameter | Parameter error. |