All Products
Search
Document Center

Cloud Monitor:DescribeAlertLogCount

Last Updated:Jan 23, 2026

Queries the statistics of alert logs.

Operation description

Queries the statistics of alert logs.

This topic provides an example on how to query the statistics of alert logs for Elastic Compute Service (ECS) based on the product dimension.

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:DescribeAlertLogCount

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

StartTime

integer

No

The start timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the AlertLogCount parameter is empty.

Note

The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.

1609988009694

EndTime

integer

No

The end timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the AlertLogCount parameter is empty.

Note

The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.

1610074409694

PageNumber

integer

No

The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:

  • product: aggregates data by cloud service.

  • level: aggregates data by alert level.

  • groupId: aggregates data by application group.

  • contactGroup: aggregates data by alert contact group.

  • product,metricName: aggregates data both by cloud service and by metric.

1

PageSize

integer

No

The number of entries to return on each page. Default value: 10.

10

SearchKey

string

No

The keyword based on which the alert logs to be counted are searched.

test

Namespace

string

No

The namespace of the cloud service.

Note

For more information about the namespaces of cloud services, see Appendix 1: Metrics.

acs_ecs_dashboard

GroupId

string

No

The ID of the application group.

7301****

Product

string

No

The abbreviation of the service name.

ECS

Level

string

No

The level and notification method of the alert. Valid values:

  • P4: Alert notifications are sent by using emails and DingTalk chatbots.

  • OK: No alert is generated.

P4

SendStatus

string

No

The status of the alert. Valid values:

  • 0: The alert is triggered or cleared.

  • 1: The alert is generated not during the effective period.

  • 2: The alert is muted and not triggered in a specified period.

  • 3: The host is restarting.

  • 4: Notifications are not sent for the alert.

When the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.

0

ContactGroup

string

No

The alert group.

ECS_Group

RuleName

string

No

The name of the alert rule.

test123

MetricName

string

No

The name of the metric.

Note

For more information about the metrics of different cloud services, see Appendix 1: Metrics.

cpu_total

LastMin

string

No

The statistical period of alert logs. Unit: minutes.

360

GroupBy

string

Yes

The dimension based on which data is aggregated. This parameter is similar to the Group By clause of SQL statements. Valid values:

  • product: aggregates data by cloud service.

  • level: aggregates data by alert level.

  • groupId: aggregates data by application group.

  • contactGroup: aggregates data by alert group.

  • product,metricName: aggregates data both by cloud service and by metric.

product

SourceType

string

No

This parameter is deprecated.

EventType

string

No

The type of the alert event. Valid values:

  • TRIGGERED: The alert is triggered.

  • RESOLVED: The alert is resolved.

TRIGGERED

RuleId

string

No

The ID of the alert rule.

For more information about how to obtain the ID of an alert rule, see DescribeMetricRuleList.

bfae2ca5b4e07d2c7278772e***********

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

Code

string

The HTTP status code.

Note

The status code 200 indicates that the request was successful.

200

Message

string

The error message.

The specified resource is not found.

RequestId

string

The request ID.

1C4A3709-BF52-42EE-87B5-7435F0929585

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

AlertLogCount

array<object>

The statistics of alert logs.

array<object>

Count

integer

The number of alert logs.

1

Logs

array<object>

The details about alert logs.

object

Name

string

The name of the dimension field based on which alert logs are aggregated.

product

Value

string

The value of the dimension field based on which alert logs are aggregated.

ECS

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "The specified resource is not found.",
  "RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
  "Success": true,
  "AlertLogCount": [
    {
      "Count": 1,
      "Logs": [
        {
          "Name": "product",
          "Value": "ECS"
        }
      ]
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 ParameterInvalid Parameter invalid.
500 InternalError The request processing has failed due to some unknown error.
403 AccessForbidden User not authorized to operate on the specified resource.
404 ResourceNotFound The specified resource is not found. The specified resource is not found.
409 ResourceConflict Concurrent modification of resources.
409 ResourceExist Resources already exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.