How do you get CloudWatch metrics into Prometheus or Grafana?
IntermediateProductionObservability as Code, Security & Vendor Choices
Answer
Three patterns:
- Grafana CloudWatch data source: query CloudWatch directly from dashboards. Simplest, no copy, but no PromQL and every panel refresh is an API call.
- YACE (yet-another-cloudwatch-exporter, prometheus-community): discovers resources by tag and exports metrics as Prometheus series with resource tags as labels. Good for alerting in Alertmanager alongside everything else.
- CloudWatch metric streams → Firehose → backend: near real-time push, cheaper than polling at scale, supported by most vendors and Grafana Cloud.
Remember CloudWatch metrics arrive with 1–5 minute delay; set YACE delay/period and alert for: durations accordingly, or you will see false gaps.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedWhat are monitoring mixins and how do you consume them?Advanced