2025/09/09 - Amazon CloudWatch - 1 new1 updated api methods
Changes Added a new API - DescribeAlarmContributors API, to retrieve alarm contributors in ALARM state. Added support in DescribeAlarmHistory API to query alarm contributor history
Returns the information of the current alarm contributors that are in ALARM state. This operation returns details about the individual time series that contribute to the alarm's state.
See also: AWS API Documentation
Request Syntax
client.describe_alarm_contributors( AlarmName='string', NextToken='string' )
string
[REQUIRED]
The name of the alarm for which to retrieve contributor information.
string
The token returned by a previous call to indicate that there is more data available.
dict
Response Syntax
{ 'AlarmContributors': [ { 'ContributorId': 'string', 'ContributorAttributes': { 'string': 'string' }, 'StateReason': 'string', 'StateTransitionedTimestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
AlarmContributors (list) --
A list of alarm contributors that provide details about the individual time series contributing to the alarm's state.
(dict) --
Represents an individual contributor to a multi-timeseries alarm, containing information about a specific time series and its contribution to the alarm's state.
ContributorId (string) --
The unique identifier for this alarm contributor.
ContributorAttributes (dict) --
A map of attributes that describe the contributor, such as metric dimensions and other identifying characteristics.
(string) --
(string) --
StateReason (string) --
An explanation for the contributor's current state, providing context about why it is in its current condition.
StateTransitionedTimestamp (datetime) --
The timestamp when the contributor last transitioned to its current state.
NextToken (string) --
The token that marks the start of the next batch of returned results.
{'AlarmContributorId': 'string', 'HistoryItemType': {'AlarmContributorAction', 'AlarmContributorStateUpdate'}}Response
{'AlarmHistoryItems': {'AlarmContributorAttributes': {'string': 'string'}, 'AlarmContributorId': 'string', 'HistoryItemType': {'AlarmContributorAction', 'AlarmContributorStateUpdate'}}}
Retrieves the history for the specified alarm. You can filter the results by date range or item type. If an alarm name is not specified, the histories for either all metric alarms or all composite alarms are returned.
CloudWatch retains the history of an alarm even if you delete the alarm.
To use this operation and return information about a composite alarm, you must be signed on with the cloudwatch:DescribeAlarmHistory permission that is scoped to *. You can't return information about composite alarms if your cloudwatch:DescribeAlarmHistory permission has a narrower scope.
See also: AWS API Documentation
Request Syntax
client.describe_alarm_history( AlarmName='string', AlarmContributorId='string', AlarmTypes=[ 'CompositeAlarm'|'MetricAlarm', ], HistoryItemType='ConfigurationUpdate'|'StateUpdate'|'Action'|'AlarmContributorStateUpdate'|'AlarmContributorAction', StartDate=datetime(2015, 1, 1), EndDate=datetime(2015, 1, 1), MaxRecords=123, NextToken='string', ScanBy='TimestampDescending'|'TimestampAscending' )
string
The name of the alarm.
string
The unique identifier of a specific alarm contributor to filter the alarm history results.
list
Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.
(string) --
string
The type of alarm histories to retrieve.
datetime
The starting date to retrieve alarm history.
datetime
The ending date to retrieve alarm history.
integer
The maximum number of alarm history records to retrieve.
string
The token returned by a previous call to indicate that there is more data available.
string
Specified whether to return the newest or oldest alarm history first. Specify TimestampDescending to have the newest event history returned first, and specify TimestampAscending to have the oldest history returned first.
dict
Response Syntax
{ 'AlarmHistoryItems': [ { 'AlarmName': 'string', 'AlarmContributorId': 'string', 'AlarmType': 'CompositeAlarm'|'MetricAlarm', 'Timestamp': datetime(2015, 1, 1), 'HistoryItemType': 'ConfigurationUpdate'|'StateUpdate'|'Action'|'AlarmContributorStateUpdate'|'AlarmContributorAction', 'HistorySummary': 'string', 'HistoryData': 'string', 'AlarmContributorAttributes': { 'string': 'string' } }, ], 'NextToken': 'string' }
Response Structure
(dict) --
AlarmHistoryItems (list) --
The alarm histories, in JSON format.
(dict) --
Represents the history of a specific alarm.
AlarmName (string) --
The descriptive name for the alarm.
AlarmContributorId (string) --
The unique identifier of the alarm contributor associated with this history item, if applicable.
AlarmType (string) --
The type of alarm, either metric alarm or composite alarm.
Timestamp (datetime) --
The time stamp for the alarm history item.
HistoryItemType (string) --
The type of alarm history item.
HistorySummary (string) --
A summary of the alarm history, in text format.
HistoryData (string) --
Data about the alarm, in JSON format.
AlarmContributorAttributes (dict) --
A map of attributes that describe the alarm contributor associated with this history item, providing context about the contributor's characteristics at the time of the event.
(string) --
(string) --
NextToken (string) --
The token that marks the start of the next batch of returned results.