Hourly CloudWatch metric snapshots into Google Sheets
Roll a fixed list of CloudWatch metrics into a Google Sheets tab every hour so any dashboard tool can chart infrastructure next to business data.
Every hour on a cron schedule, snapshot a fixed list of Amazon CloudWatch metrics into a Google Sheets tab so I can build BI dashboards on top of live infrastructure data without paying for a dedicated observability platform.
Treat the metric list as configuration on the workflow. Each entry has a namespace (e.g. AWS/ApplicationELB, AWS/EC2, AWS/Lambda), a metric name (e.g. HTTPCode_Target_5XX_Count, TargetResponseTime, RequestCount, CPUUtilization), a statistic (Average, Sum, p95, and so on), a unit hint, and an optional set of dimensions (LoadBalancer, InstanceId, FunctionName, and the like). Start with error rate, p95 latency, request count, and CPU utilization as sensible defaults, and make it easy for me to add or remove metrics later without changing the code.
For each configured metric, call Amazon CloudWatch Get Metric Data with a start time of one hour ago, an end time of now, and a period of 60 seconds so I get one data point per minute. Batch the metric queries into a single Get Metric Data call where possible to stay well under the CloudWatch throttling quota. Preserve the exact timestamp CloudWatch returns for each data point (ISO 8601 UTC) rather than the workflow run time.
Then call Google Sheets Append Values on the target spreadsheet and tab, adding one row per metric per timestamp. The columns, in order, are: run_at (workflow run time, ISO 8601 UTC), timestamp (the CloudWatch data point time), metric_name, namespace, dimensions (a stable serialized string like key1=value1;key2=value2, sorted by key so joins work), statistic, value, and unit. Use valueInputOption=RAW so CloudWatch's numeric values and ISO timestamps land unmodified and analysts can parse them downstream.
This is a pure deterministic ETL: no AI judgement, no summarisation, no filtering beyond what the configured metric list defines. The metric list, columns, and cadence are fixed, so the workflow should be code and every step should be a documented operation (CloudWatch Get Metric Data de69d4c7-3a3f-4390-9d41-c7793fab79a3, Google Sheets Append Values b8bb536a-33b9-455a-a00b-a652450a6431).
Handle the obvious edge cases: if CloudWatch returns no data points for a metric in the window (common for low-traffic services), skip it silently rather than writing an empty row. If Get Metric Data returns a NextToken, follow the pagination until the full hour is retrieved. Retry Google Sheets 429s and 503s with exponential backoff, capped at a few attempts, so a transient rate-limit does not lose an hour of data.
The sheet becomes the canonical time series that a Looker Studio report, a Sheets chart, or a downstream analyst can join against business data such as deploys, marketing pushes, and feature launches. Keep the column names stable across runs so dashboards built on top do not break.
Additional information
What does this prompt do?
- Every hour, pulls the CloudWatch metrics you configure (error rate, p95 latency, request count, CPU, anything else) at a one-minute resolution.
- Appends one row per metric per timestamp to a Google Sheets tab with columns for metric name, namespace, dimensions, statistic, value, and unit.
- Turns the sheet into a canonical time series you can chart in Looker Studio, in Sheets itself, or blend with deploys and marketing pushes in your existing BI tool.
- Runs deterministically on a schedule, so the format never drifts and analysts can trust the columns week over week.
What do I need to use this?
- An AWS account with CloudWatch access and a read-only key for the region your metrics live in
- A Google account and a Google Sheets file with a tab you want the metrics appended to
- Your list of metrics: for each one, the namespace, metric name, any dimensions, and the statistic you care about (average, sum, p95, and so on)
How can I customize it?
- Edit the metric list at any time to add services, change dimensions, or swap statistics without touching the rest of the workflow
- Change the cadence to every 15 minutes, every four hours, or once a day depending on how fresh your dashboards need to be
- Point at a different Sheets tab, split by environment (prod, staging), or add extra columns like a friendly service name or team owner
Frequently asked questions
Why send CloudWatch data to a spreadsheet instead of using the AWS console?
Does this replace a full observability platform like Datadog or New Relic?
How much data will land in the sheet each hour?
Will the Google Sheet get too big to open?
Do I need AWS admin access to set this up?
Related templates
Turn CloudWatch into a spreadsheet you can chart against anything.
Set your metric list once and let the workflow drop a fresh batch of rows into Google Sheets every hour, ready for Looker Studio, Sheets charts, or your analyst's join.