Create CloudWatch metric math expressions and composite alarms

domain: docs.aws.amazon.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define metric math expressions in GetMetricData API calls using the 'MetricDataQueries' array; each query is either a raw metric ('MetricStat') or a math expression ('Expression') referencing other query IDs
  2. Use metric math functions such as ANOMALY_DETECTION_BAND, FILL, RATE, SUM, AVG, and IF to compute derived signals; reference other queries by their 'Id' field in expressions like 'SUM([m1, m2])'
  3. Create a standard CloudWatch alarm via 'PutMetricAlarm' API (or aws cloudwatch put-metric-alarm CLI) specifying 'Metrics' array with math expressions for threshold-based alerting on computed values
  4. Create a composite alarm via 'PutCompositeAlarm' API with 'AlarmRule' as a boolean expression combining existing alarm states: 'ALARM("alarm1") AND ALARM("alarm2")' or with OR/NOT operators
  5. Set 'AlarmActions' and 'OKActions' to SNS topic ARNs for notifications; configure 'TreatMissingData' as 'breaching', 'notBreaching', 'ignore', or 'missing' to control alarm state during data gaps

Known gotchas

Related routes

Create an AWS CloudWatch Synthetics canary in Node.js to monitor a critical API endpoint and trigger alarms on failure
docs.aws.amazon.com · 6 steps · unrated
Configure a Grafana alert rule with a threshold on an industrial timeseries metric and route it to a contact point
grafana.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans