CloudWatch

Query and monitor AWS CloudWatch logs, metrics, and alarms

AWS CloudWatch is a monitoring and observability service that provides data and actionable insights for AWS resources, applications, and services. CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, giving you a unified view of your AWS environment.

With the CloudWatch integration, you can:

  • Query Logs (Insights): Run CloudWatch Log Insights queries against one or more log groups to analyze log data with a powerful query language
  • Describe Log Groups: List available CloudWatch log groups in your account, optionally filtered by name prefix
  • Get Log Events: Retrieve log events from a specific log stream within a log group
  • Describe Log Streams: List log streams within a log group, ordered by last event time or filtered by name prefix
  • List Metrics: Browse available CloudWatch metrics, optionally filtered by namespace, metric name, or recent activity
  • Get Metric Statistics: Retrieve statistical data for a metric over a specified time range with configurable granularity
  • Publish Metric: Publish custom metric data points to CloudWatch for your own application monitoring
  • Describe Alarms: List and filter CloudWatch alarms by name prefix, state, or alarm type

In Sim, the CloudWatch integration enables your agents to monitor AWS infrastructure, analyze application logs, track custom metrics, and respond to alarm states as part of automated DevOps and SRE workflows. This is especially powerful when combined with other AWS integrations like CloudFormation and SNS for end-to-end infrastructure management.

Usage Instructions

Integrate AWS CloudWatch into workflows. Run Log Insights queries, list log groups, retrieve log events, list and get metrics, and monitor alarms. Requires AWS access key and secret access key.

Tools

cloudwatch_query_logs

Run a CloudWatch Log Insights query against one or more log groups

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamesarrayYesLog group names to query
queryStringstringYesCloudWatch Log Insights query string
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
limitnumberNoMaximum number of results to return

Output

ParameterTypeDescription
resultsarrayQuery result rows (each row is a key/value map of field name to value)
statisticsobjectQuery statistics
bytesScannednumberTotal bytes of log data scanned
recordsMatchednumberNumber of log records that matched the query
recordsScannednumberTotal log records scanned
statusstringQuery completion status (Complete, Failed, Cancelled, or Timeout)

cloudwatch_describe_log_groups

List available CloudWatch log groups

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
prefixstringNoFilter log groups by name prefix
limitnumberNoMaximum number of log groups to return

Output

ParameterTypeDescription
logGroupsarrayList of CloudWatch log groups with metadata
logGroupNamestringLog group name
arnstringLog group ARN
storedBytesnumberTotal stored bytes
retentionInDaysnumberRetention period in days (if set)
creationTimenumberCreation time in epoch milliseconds

cloudwatch_get_log_events

Retrieve log events from a specific CloudWatch log stream

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamestringYesCloudWatch log group name
logStreamNamestringYesCloudWatch log stream name
startTimenumberNoStart time as Unix epoch seconds
endTimenumberNoEnd time as Unix epoch seconds
limitnumberNoMaximum number of events to return

Output

ParameterTypeDescription
eventsarrayLog events with timestamp, message, and ingestion time
timestampnumberEvent timestamp in epoch milliseconds
messagestringLog event message
ingestionTimenumberIngestion time in epoch milliseconds

cloudwatch_describe_log_streams

List log streams within a CloudWatch log group

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
logGroupNamestringYesCloudWatch log group name
prefixstringNoFilter log streams by name prefix
limitnumberNoMaximum number of log streams to return

Output

ParameterTypeDescription
logStreamsarrayList of log streams with metadata, sorted by last event time (most recent first) unless a prefix filter is applied
logStreamNamestringLog stream name
lastEventTimestampnumberTimestamp of the last log event in epoch milliseconds
firstEventTimestampnumberTimestamp of the first log event in epoch milliseconds
creationTimenumberStream creation time in epoch milliseconds
storedBytesnumberTotal stored bytes

cloudwatch_list_metrics

List available CloudWatch metrics

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namespacestringNoFilter by namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringNoFilter by metric name
recentlyActivebooleanNoOnly show metrics active in the last 3 hours
limitnumberNoMaximum number of metrics to return

Output

ParameterTypeDescription
metricsarrayList of metrics with namespace, name, and dimensions
namespacestringMetric namespace (e.g., AWS/EC2)
metricNamestringMetric name (e.g., CPUUtilization)
dimensionsarrayArray of name/value dimension pairs

cloudwatch_get_metric_statistics

Get statistics for a CloudWatch metric over a time range

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namespacestringYesMetric namespace (e.g., AWS/EC2, AWS/Lambda)
metricNamestringYesMetric name (e.g., CPUUtilization, Invocations)
startTimenumberYesStart time as Unix epoch seconds
endTimenumberYesEnd time as Unix epoch seconds
periodnumberYesGranularity in seconds (e.g., 60, 300, 3600)
statisticsarrayYesStatistics to retrieve (Average, Sum, Minimum, Maximum, SampleCount)
dimensionsstringNoDimensions as JSON (e.g., {"InstanceId": "i-1234"})

Output

ParameterTypeDescription
labelstringMetric label returned by CloudWatch
datapointsarrayDatapoints sorted by timestamp with statistics values
timestampnumberDatapoint timestamp in epoch milliseconds
averagenumberAverage statistic value
sumnumberSum statistic value
minimumnumberMinimum statistic value
maximumnumberMaximum statistic value
sampleCountnumberSample count statistic value
unitstringUnit of the metric

cloudwatch_put_metric_data

Publish a custom metric data point to CloudWatch

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
namespacestringYesMetric namespace (e.g., Custom/MyApp)
metricNamestringYesName of the metric
valuenumberYesMetric value to publish
unitstringNoUnit of the metric (e.g., Count, Seconds, Bytes)
dimensionsstringNoJSON string of dimension name/value pairs

Output

ParameterTypeDescription
successbooleanWhether the metric was published successfully
namespacestringMetric namespace
metricNamestringMetric name
valuenumberPublished metric value
unitstringMetric unit
timestampstringTimestamp when the metric was published

cloudwatch_describe_alarms

List and filter CloudWatch alarms

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
alarmNamePrefixstringNoFilter alarms by name prefix
stateValuestringNoFilter by alarm state (OK, ALARM, INSUFFICIENT_DATA)
alarmTypestringNoFilter by alarm type (MetricAlarm, CompositeAlarm)
limitnumberNoMaximum number of alarms to return

Output

ParameterTypeDescription
alarmsarrayList of CloudWatch alarms with state and configuration
alarmNamestringAlarm name
alarmArnstringAlarm ARN
stateValuestringCurrent state (OK, ALARM, INSUFFICIENT_DATA)
stateReasonstringHuman-readable reason for the state
metricNamestringMetric name (MetricAlarm only)
namespacestringMetric namespace (MetricAlarm only)
thresholdnumberThreshold value (MetricAlarm only)
stateUpdatedTimestampnumberEpoch ms when state last changed

cloudwatch_mute_alarm

Create a CloudWatch alarm mute rule that suppresses alarms for a fixed duration

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
muteRuleNamestringYesUnique name for the mute rule (used later to unmute)
alarmNamesarrayYesNames of the CloudWatch alarms this mute rule targets
durationValuenumberYesHow long the mute lasts (paired with durationUnit)
durationUnitstringYesUnit for durationValue: minutes, hours, or days
descriptionstringNoOptional description of why the alarms are being muted
startDatenumberNoWhen the mute window begins as Unix epoch seconds. Defaults to now (mute starts immediately).

Output

ParameterTypeDescription
successbooleanWhether the mute rule was created successfully
muteRuleNamestringName of the mute rule that was created
alarmNamesarrayNames of the alarms this rule mutes
expressionstringSchedule expression used by the mute rule
durationstringISO 8601 duration of the mute window

cloudwatch_unmute_alarm

Delete a CloudWatch alarm mute rule, restoring alarm notifications

Input

ParameterTypeRequiredDescription
awsRegionstringYesAWS region (e.g., us-east-1)
awsAccessKeyIdstringYesAWS access key ID
awsSecretAccessKeystringYesAWS secret access key
muteRuleNamestringYesName of the mute rule to delete

Output

ParameterTypeDescription
successbooleanWhether the mute rule was deleted successfully
muteRuleNamestringName of the mute rule that was deleted

On this page