All Products
Search
Document Center

CloudMonitor:DescribeAlertLogHistogram

Last Updated:Mar 01, 2024

Queries the number of alert logs that are generated during each interval within a period of time.

Operation description

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

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
StartTimelongNo

The start timestamp of the alert logs to be queried.

Unit: milliseconds.

Note
  • You can query only the alert logs within the last year.

  • The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days.

1609988009694
EndTimelongNo

The end timestamp of the alert logs to be queried.

Unit: milliseconds.

Note
  • You can query only the alert logs within the last year.

  • The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days.

1609989009694
PageNumberintegerNo

The page number.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

Default value: 10.

10
SearchKeystringNo

The keyword that is used to query alert logs.

alert
GroupIdstringNo

The ID of the application group.

7301****
ProductstringNo

The abbreviation of the Alibaba Cloud service name.

ECS
NamespacestringNo

The namespace of the Alibaba Cloud service.

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

The severity level and notification methods of the alert. Valid values:

  • P4: Alert notifications are sent by using emails and DingTalk chatbots.
  • OK: No alert is generated.
P4
SendStatusstringNo

The alert status. Valid values:

  • 0: The alert is triggered or cleared.
  • 1: The alert is ineffective.
  • 2: The alert is muted and not triggered in a specified period.
  • 3: The host is restarting.
  • 4: No alert notification is sent.

If 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
ContactGroupstringNo

The alert contact group.

ECS_Group
RuleNamestringNo

The name of the alert rule.

test123
MetricNamestringNo

The metric name.

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

The statistical period of alert logs. Unit: minutes.

360
GroupBystringNo

The dimensions 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.
product
SourceTypestringNo

This parameter is deprecated.

None
EventTypestringNo

The type of the alert event. Valid values:

  • TRIGGERED: The alert is triggered.
  • RESOLVED: The alert is resolved.
RESOLVED
RuleIdstringNo

The ID of the alert rule.

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

ae06917_75a8c43178ab66****

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

Response parameters

ParameterTypeDescriptionExample
object

None.

Codestring

The response code.

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

The error message.

The specified resource is not found.
RequestIdstring

The request ID.

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

Indicates whether the request was successful. Valid values:

  • true
  • false
true
AlertLogHistogramListobject []

The number of alert logs that were generated during each interval of a time period.

Fromlong

The start timestamp of the queried alert logs.

Unit: seconds.

1610074791
Tolong

The end timestamp of the queried alert logs.

Unit: seconds.

1610074800
Countinteger

The number of alert logs.

20

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "The specified resource is not found.",
  "RequestId": "1C4A3709-BF52-42EE-87B5-7435F0929585",
  "Success": true,
  "AlertLogHistogramList": [
    {
      "From": 1610074791,
      "To": 1610074800,
      "Count": 20
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalid%s-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
409ResourceConflictConcurrent modification of resources.-
409ResourceExistResources already exist.-
500InternalErrorThe request processing has failed due to some unknown error.-

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

Change history

Change timeSummary of changesOperation
2023-12-07The 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: 409
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: EventType
    Added Input Parameters: RuleId
2023-07-27The 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: 409
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: SourceType