All Products
Search
Document Center

CloudMonitor:DescribeHybridMonitorTaskList

Last Updated:Mar 01, 2024

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.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
KeywordstringNo

The keyword that is used for the search.

task
TaskIdstringNo

The ID of the metric import task.

36****
GroupIdstringNo

The ID of the application group.

For information about how to obtain the ID of an application group, see DescribeMonitorGroups .

3607****
NamespacestringNo

The name of the namespace.

For information about how to obtain the name of a namespace, see DescribeHybridMonitorNamespaceList .

aliyun
PageSizeintegerNo

The number of entries per page.

Pages start from page 1. Default value: 10.

10
PageNumberintegerNo

The page number.

Pages start from page 1. Default value: 1.

1
IncludeAliyunTaskbooleanNo

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
TaskTypestringNo

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_fc
TargetUserIdlongNo

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 parameters

ParameterTypeDescriptionExample
object

None

RequestIdstring

The request ID.

11145B76-566A-5D80-A8A3-FAD98D310079
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Codestring

The status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The returned message.

  • If the request was successful, the value successful is returned.
  • If the request failed, an error message is returned.
success
PageSizeinteger

The number of entries per page.

10
PageNumberinteger

The page number.

1
Totalinteger

The total number of entries returned.

1
TaskListobject []

The metric import tasks.

YARMConfigstring

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
CreateTimestring

The timestamp when the metric import task was created.

Unit: milliseconds.

1639382496000
TaskNamestring

The name of the metric import task.

aliyun_task
Namespacestring

The namespace to which the host belongs.

aliyun
UploadRegionstring

The region where the host resides.

cn-hangzhou
NetworkTypestring

The network type of the host. Valid values:

  • vpc
  • Internet
vpc
CollectTimoutinteger

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

  • 0
  • 15
  • 30
  • 60

Unit: seconds.

15
CollectTargetEndpointstring

The URL of the destination from which the CloudMonitor agent collects host monitoring data.

http://localhost
TaskTypestring

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
MatchExpressRelationstring

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

  • or
  • and
or
Descriptionstring

The description of the metric import task.

aliyun
GroupIdstring

The ID of the application group.

3607****
CollectIntervalinteger

The interval at which the CloudMonitor agent collects host monitoring data. Valid values:

  • 15
  • 30
  • 60

Unit: seconds.

60
TargetUserIdstring

The ID of the member account.

Note This parameter is displayed only when you call this operation by using a management account.
120886317861****
CollectTargetPathstring

The relative path from which the CloudMonitor agent collects monitoring data.

/metrics
CollectTargetTypestring

The type of the monitoring data. Valid values: Spring, Tomcat, Nginx, Tengine, JVM, Redis, and MySQL.

nginx
TaskIdstring

The ID of the metric import task.

36****
AttachLabelsobject []

The tags of the metric import task.

Namestring

The tag key.

key1
Valuestring

The tag value.

value1
MatchExpressobject []

The conditions that are used to match the instances in the application group.

Valuestring

The keyword that corresponds to the instance name.

ECS_instance1
Namestring

The instance name.

name
Functionstring

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
Instancesarray

The instances where monitoring data is collected in batches.

string

The instance ID.

i-hp368focau7dp0hw****
ExtraInfostring

The additional information of the instance.

test
LogFilePathstring

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
LogSplitstring

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"}]}}]}
LogProcessstring

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"}]}]
LogSamplestring

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"]}}
SLSProcessstring

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"}]}
SLSProcessConfigobject

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.
Filterobject

The conditions that are used to filter logs imported from Log Service.

Relationstring

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
Filtersobject []

The conditions that are used to filter logs imported from Log Service.

SLSKeyNamestring

The name of the key that is used to filter logs imported from Log Service.

host
Operatorstring

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
=
Valuestring

The value of the key that is used to filter logs imported from Log Service.

200
Statisticsobject []

The methods that are used to aggregate logs imported from Log Service.

SLSKeyNamestring

The name of the key that is used to aggregate logs imported from Log Service.

name
Functionstring

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
Aliasstring

The alias of the aggregation result.

level_count
Parameter1string

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
Parameter2string

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
GroupByobject []

The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.

SLSKeyNamestring

The name of the key that is used to aggregate logs imported from Log Service.

code
Aliasstring

The alias of the aggregation result.

ApiResult
Expressobject []

The extended fields that indicate the results of basic operations that are performed on aggregation results.

Expressstring

The extended field that indicates the result of basic operations that are performed on aggregation results.

success_count
Aliasstring

The alias of the extended field that indicates the result of basic operations that are performed on aggregation results.

SuccRate

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400%s%s
500InternalError%s

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-07-20The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: TargetUserId
2021-10-25Add Operationsee changesets