Queries metric import tasks.
Operation description
This topic provides an example on how to query all metric import tasks that belong to the current Alibaba Cloud account. The returned result indicates that the current account has only one metric import task. The metric import task is named aliyun_task.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeHybridMonitorTaskList |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Keyword |
string |
No |
The keyword that is used for the search. |
task |
| TaskId |
string |
No |
The ID of the metric import task. |
36**** |
| GroupId |
string |
No |
The ID of the application group. For information about how to obtain the ID of an application group, see DescribeMonitorGroups. |
3607**** |
| Namespace |
string |
No |
The name of the namespace. For information about how to obtain the name of a namespace, see DescribeHybridMonitorNamespaceList. |
aliyun |
| PageSize |
integer |
No |
The number of entries per page. Pages start from page 1. Default value: 10. |
10 |
| PageNumber |
integer |
No |
The page number. Pages start from page 1. Default value: 1. |
1 |
| IncludeAliyunTask |
boolean |
No |
Specifies whether the returned result includes metric import tasks for Alibaba Cloud services. Valid values:
|
true |
| TaskType |
string |
No |
The type of the metric import task. Valid values:
Valid values:
|
aliyun_fc |
| TargetUserId |
integer |
No |
The ID of the member account. Note
This parameter is required only if you use a management account to call this operation to delete the metric import tasks that belong to a member in a resource directory. In this case, the |
120886317861**** |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None |
||
| RequestId |
string |
The request ID. |
11145B76-566A-5D80-A8A3-FAD98D310079 |
| Success |
string |
Indicates whether the request was successful. Valid values:
|
true |
| Code |
string |
The status code. Note
The status code 200 indicates that the request was successful. |
200 |
| Message |
string |
The returned message.
|
success |
| PageSize |
integer |
The number of entries per page. |
10 |
| PageNumber |
integer |
The page number. |
1 |
| Total |
integer |
The total number of entries returned. |
1 |
| TaskList |
array<object> |
The metric import tasks. |
|
|
array<object> |
None |
||
| YARMConfig |
string |
The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.
|
products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total |
| CreateTime |
string |
The timestamp when the metric import task was created. Unit: milliseconds. |
1639382496000 |
| TaskName |
string |
The name of the metric import task. |
aliyun_task |
| Namespace |
string |
The namespace to which the host belongs. |
aliyun |
| UploadRegion |
string |
The region where the host resides. |
cn-hangzhou |
| NetworkType |
string |
The network type of the host. Valid values:
|
vpc |
| CollectTimout |
integer |
The timeout period during which the CloudMonitor agent collects host monitoring data. Valid values:
Unit: seconds. |
15 |
| CollectTargetEndpoint |
string |
The URL of the destination from which the CloudMonitor agent collects host monitoring data. |
http://localhost |
| TaskType |
string |
The type of the metric import task. Valid values:
|
aliyun_sls |
| MatchExpressRelation |
string |
The relationship between the conditions that are used to filter metric import tasks. Valid values:
|
or |
| Description |
string |
The description of the metric import task. |
aliyun |
| GroupId |
string |
The ID of the application group. |
3607**** |
| CollectInterval |
integer |
The interval at which the CloudMonitor agent collects host monitoring data. Valid values:
Unit: seconds. |
60 |
| TargetUserId |
string |
The ID of the member account. Note
This parameter is displayed only when you call this operation by using a management account. |
120886317861**** |
| CollectTargetPath |
string |
The relative path from which the CloudMonitor agent collects monitoring data. |
/metrics |
| CollectTargetType |
string |
The type of the monitoring data. Valid values: Spring, Tomcat, Nginx, Tengine, JVM, Redis, and MySQL. |
nginx |
| TaskId |
string |
The ID of the metric import task. |
36**** |
| AttachLabels |
array<object> |
The tags of the metric import task. |
|
|
object |
None |
||
| Name |
string |
The tag key. |
key1 |
| Value |
string |
The tag value. |
value1 |
| MatchExpress |
array<object> |
The conditions that are used to match the instances in the application group. |
|
|
object |
None |
||
| Value |
string |
The keyword that corresponds to the instance name. |
ECS_instance1 |
| Name |
string |
The instance name. |
name |
| Function |
string |
The method that is used to match the instance name. Valid values:
|
all |
| Instances |
array |
The instances where monitoring data is collected in batches. |
|
|
string |
The instance ID. |
i-hp368focau7dp0hw**** |
|
| ExtraInfo |
string |
The additional information of the instance. |
test |
| LogFilePath |
string |
The path where on-premises log data is stored. On-premises log data is stored in the specified path of the host where CloudMonitor is deployed.
|
C:\UserData\log\*.Log |
| LogSplit |
string |
The result that is returned after on-premises log data is split based on the specified matching mode. Note
The matching modes of on-premises log data include full regex mode, delimiter mode, and JSON mode. |
{"type": "regex","regex": "\\d+\\.\\d+\\.\\d+\\.\\d+\\s+(\\d+)\\s+\\S+\\s+\\[\\d+/\\S+/\\d+:\\d+:\\d+:\\d+\\s+\\+\\d+\\]\\s+(\\S+)\\s+\\S+\\s+/\\S+/\\S+/\\S+\\s+(\\d+)","columns": [{"name": "field1"},{"name": "filed2","translate": {"default": "-","mappings": [{"from": "(\\w+)","to": "$1x","type": "regex"}]}},{"name": "filed3","translate": {"default": "-","mappings": [{"from": "NumberRange(100,300)","to": "true","type": "function"}]}}]} |
| LogProcess |
string |
The method that is used to aggregate on-premises log data. |
[{"metric": "metric1","filters": [{"column": "filed2","type": "include","values": ["222222"]}],"groupBys": [{"column": "filed3","name": "filed3"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]},{"metric": "metric2","filters": [{"column": "field1","type": "include","values": ["11111"]}],"groupBys": [{"column": "filed2","name": "filed2"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]}] |
| LogSample |
string |
The sample on-premises log. |
{"logContent":"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \"-\" \"127.0.0.1:7001\" \"Go-http-client/1.1\" \"-\" \"-\" \"0a98a21a15656865460656276e\"","addData":{"field1":["1119","1119"],"filed2":["POSTx","POST"],"filed3":["true","200"]}} |
| SLSProcess |
string |
The configurations of the logs that are imported from Log Service. |
{"express": [],"filter": {"filters": [{"key": "task_type","operator": "=","value": "1"}]},"groupby": [{"alias": "isp","key": "isp","sqlKey": "t.`isp`","valueKey": "isp"}],"interval": 60,"labels": [{"name": "__cms_app__","type": 0,"value": "sitemonitor"}],"statistics": [{"alias": "http_dns_time_avg","function": "avg","key": "http_dns_time"}]} |
| SLSProcessConfig |
object |
The configurations of the logs that are imported from Log Service. Note
This parameter is returned only if the |
|
| Filter |
object |
The conditions that are used to filter logs imported from Log Service. |
|
| Relation |
string |
The relationship between multiple filter conditions. Valid values:
|
and |
| Filters |
array<object> |
The conditions that are used to filter logs imported from Log Service. |
|
|
object |
The conditions that are used to filter logs imported from Log Service. |
||
| SLSKeyName |
string |
The name of the key that is used to filter logs imported from Log Service. |
host |
| Operator |
string |
The method that is used to filter logs imported from Log Service. Valid values:
|
= |
| Value |
string |
The value of the key that is used to filter logs imported from Log Service. |
200 |
| Statistics |
array<object> |
The methods that are used to aggregate logs imported from Log Service. |
|
|
object |
The method that is used to aggregate logs imported from Log Service. |
||
| SLSKeyName |
string |
The name of the key that is used to aggregate logs imported from Log Service. |
name |
| Function |
string |
The function that is used to aggregate log data within a statistical period. Valid values:
|
count |
| Alias |
string |
The alias of the aggregation result. |
level_count |
| Parameter1 |
string |
The value of the function that is used to aggregate logs imported from Log Service.
|
200 |
| Parameter2 |
string |
The value of the function that is used to aggregate logs imported from Log Service. Note
This parameter is returned only if the |
299 |
| GroupBy |
array<object> |
The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. |
|
|
object |
The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. |
||
| SLSKeyName |
string |
The name of the key that is used to aggregate logs imported from Log Service. |
code |
| Alias |
string |
The alias of the aggregation result. |
ApiResult |
| Express |
array<object> |
The extended fields that indicate the results of basic operations that are performed on aggregation results. |
|
|
object |
The extended field that indicates the result of basic operations that are performed on aggregation results. |
||
| Express |
string |
The extended field that indicates the result of basic operations that are performed on aggregation results. |
success_count |
| Alias |
string |
The alias of the extended field that indicates the result of basic operations that are performed on aggregation results. |
SuccRate |
Examples
Success response
JSON format
{
"RequestId": "11145B76-566A-5D80-A8A3-FAD98D310079",
"Success": "true",
"Code": "200",
"Message": "success",
"PageSize": 10,
"PageNumber": 1,
"Total": 1,
"TaskList": [
{
"YARMConfig": "products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total",
"CreateTime": "1639382496000",
"TaskName": "aliyun_task",
"Namespace": "aliyun",
"UploadRegion": "cn-hangzhou",
"NetworkType": "vpc",
"CollectTimout": 15,
"CollectTargetEndpoint": "http://localhost",
"TaskType": "aliyun_sls",
"MatchExpressRelation": "or",
"Description": "aliyun",
"GroupId": "3607****",
"CollectInterval": 60,
"TargetUserId": "120886317861****",
"CollectTargetPath": "/metrics",
"CollectTargetType": "nginx",
"TaskId": "36****",
"AttachLabels": [
{
"Name": "key1",
"Value": "value1"
}
],
"MatchExpress": [
{
"Value": "ECS_instance1",
"Name": "name",
"Function": "all"
}
],
"Instances": [
"i-hp368focau7dp0hw****"
],
"ExtraInfo": "test",
"LogFilePath": "C:\\UserData\\log\\*.Log",
"LogSplit": "{\"type\": \"regex\",\"regex\": \"\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\s+(\\\\d+)\\\\s+\\\\S+\\\\s+\\\\[\\\\d+/\\\\S+/\\\\d+:\\\\d+:\\\\d+:\\\\d+\\\\s+\\\\+\\\\d+\\\\]\\\\s+(\\\\S+)\\\\s+\\\\S+\\\\s+/\\\\S+/\\\\S+/\\\\S+\\\\s+(\\\\d+)\",\"columns\": [{\"name\": \"field1\"},{\"name\": \"filed2\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"(\\\\w+)\",\"to\": \"$1x\",\"type\": \"regex\"}]}},{\"name\": \"filed3\",\"translate\": {\"default\": \"-\",\"mappings\": [{\"from\": \"NumberRange(100,300)\",\"to\": \"true\",\"type\": \"function\"}]}}]}",
"LogProcess": "[{\"metric\": \"metric1\",\"filters\": [{\"column\": \"filed2\",\"type\": \"include\",\"values\": [\"222222\"]}],\"groupBys\": [{\"column\": \"filed3\",\"name\": \"filed3\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]},{\"metric\": \"metric2\",\"filters\": [{\"column\": \"field1\",\"type\": \"include\",\"values\": [\"11111\"]}],\"groupBys\": [{\"column\": \"filed2\",\"name\": \"filed2\"}],\"calculates\": [{\"column\": \"field1\",\"name\": \"avg\",\"type\": \"avg\"}]}]",
"LogSample": "{\"logContent\":\"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \\\"-\\\" \\\"127.0.0.1:7001\\\" \\\"Go-http-client/1.1\\\" \\\"-\\\" \\\"-\\\" \\\"0a98a21a15656865460656276e\\\"\",\"addData\":{\"field1\":[\"1119\",\"1119\"],\"filed2\":[\"POSTx\",\"POST\"],\"filed3\":[\"true\",\"200\"]}}",
"SLSProcess": "{\"express\": [],\"filter\": {\"filters\": [{\"key\": \"task_type\",\"operator\": \"=\",\"value\": \"1\"}]},\"groupby\": [{\"alias\": \"isp\",\"key\": \"isp\",\"sqlKey\": \"t.`isp`\",\"valueKey\": \"isp\"}],\"interval\": 60,\"labels\": [{\"name\": \"__cms_app__\",\"type\": 0,\"value\": \"sitemonitor\"}],\"statistics\": [{\"alias\": \"http_dns_time_avg\",\"function\": \"avg\",\"key\": \"http_dns_time\"}]}",
"SLSProcessConfig": {
"Filter": {
"Relation": "and",
"Filters": [
{
"SLSKeyName": "host",
"Operator": "=",
"Value": "200"
}
]
},
"Statistics": [
{
"SLSKeyName": "name",
"Function": "count",
"Alias": "level_count",
"Parameter1": "200",
"Parameter2": "299"
}
],
"GroupBy": [
{
"SLSKeyName": "code",
"Alias": "ApiResult"
}
],
"Express": [
{
"Express": "success_count",
"Alias": "SuccRate"
}
]
}
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | %s | %s | |
| 500 | %s | %s | |
| 500 | InternalError | %s | |
| 403 | %s | %s | |
| 404 | %s | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.