All Products
Search
Document Center

Cloud Monitor:DescribeHybridMonitorTaskList

Last Updated:Jan 23, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 (default): The returned result includes metric import tasks for Alibaba Cloud services.

  • false: The returned result excludes metric import tasks for Alibaba Cloud services.

true

TaskType

string

No

The type of the metric import task. Valid values:

  • aliyun_fc: metric import tasks for Alibaba Cloud services

  • aliyun_sls: metrics for logs imported from Log Service

Valid values:

  • aliyun_sls :

    aliyun_sls

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 TaskType parameter is set to aliyun_fc.

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

  • false

true

Code

string

The status code.

Note

The status code 200 indicates that the request was successful.

200

Message

string

The returned message.

  • If the request was successful, the value successful is returned.

  • If the request failed, an error message is returned.

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.

  • namespace: the namespace of the Alibaba Cloud service.

  • metric_list: the metrics of the Alibaba Cloud service.

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

  • Internet

vpc

CollectTimout

integer

The timeout period during which the CloudMonitor agent collects host monitoring data. Valid values:

  • 0

  • 15

  • 30

  • 60

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_fc: metric import tasks for Alibaba Cloud services

  • aliyun_sls: metrics for logs imported from Log Service

aliyun_sls

MatchExpressRelation

string

The relationship between the conditions that are used to filter metric import tasks. Valid values:

  • or

  • and

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:

  • 15

  • 30

  • 60

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:

  • startWith: starts with a prefix

  • endWith: ends with a suffix

  • all: matches all

  • equals: equals

  • contains: contains

  • notContains: does not contain

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.

  • Windows: The log path must start with a drive letter. Example: C:\UserData\log\\*.Log. You cannot specify wildcard characters in a log path.

  • Linux: The log path must start with a forward slash (/). Example: /home/appdata/log/**/*.log. In this example, /**/ is used to match all files in the appdata directory.

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 TaskType parameter is set to aliyun_sls.

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 (default): Logs are processed only if all filter conditions are met.

  • or: Logs are processed if one of the filter conditions is met.

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:

  • contain: contains

  • notContain: does not contain

  • >: greater than

  • <: less than

  • =: equal to

  • ! =: not equal to

  • >=: greater than or equal to

  • <=: less than or equal to

=

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: counts the number.

  • sum: calculates the total value.

  • avg: calculates the average value.

  • max: calculates the maximum value.

  • min: calculates the minimum value.

  • value: collects samples within the statistical period.

  • countps: calculates the average number of the specified field per second by using the following formula: Counted number of the specified field/Total number of seconds within the statistical period.

  • sumps: calculates the average number of the specified field per second by using the following formula: Total value of the specified field/Total number of seconds within the statistical period.

  • distinct: counts the number of logs where the specified field appears within the statistical period.

  • distribution: counts the number of logs that meet a specified condition within the statistical period.

  • percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.

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.

  • If the Function parameter is set to distribution, this parameter indicates the lower limit of the statistical interval. For example, 200 indicates that the number of HTTP requests whose status code is 2XX is calculated.

  • If the Function parameter is set to percentile, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.

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 Function parameter is set to distribution. This parameter indicates the upper limit of the statistical interval. For example, 299 indicates that the number of HTTP requests whose status code is 2XX is calculated.

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.