AWS in 1 Min · Episode 153

Amazon CloudWatch metrics explained: namespaces, dimensions and percentiles

Numbers your systems report. Watch the one-minute video, then read the details.

David Gomez1:14 video · 2 min read

"If the server is up, the app is healthy." Not even close. A page that takes eight seconds, a payment API that fails one call in twenty, a queue that keeps growing: none of these crash a server, and all of them cost you customers. To see them you need numbers over time, and on AWS those numbers are Amazon CloudWatch metrics.

What a metric is

A metric is a time-ordered series of data points: CPU utilization, request count, error count, queue depth. Each data point has a timestamp, a value and, optionally, a unit.

Metrics are organized by three things:

  • Namespace: a container that keeps metrics apart. AWS services use AWS/<service>, for example AWS/EC2 or AWS/Lambda.
  • Metric name: for example CPUUtilization.
  • Dimensions: name/value pairs that say which resource the data describes, such as InstanceId=i-0abc…. A metric can have up to 30 dimensions, and each unique combination is a separate metric.

Metrics live in the Region where they are created.

Where metrics come from

Many AWS services publish metrics at no charge: EC2, EBS, RDS, Lambda, load balancers and more. Your application can publish custom metrics (orders per minute, checkout failures) with the PutMetricData API or the embedded metric format in logs. Custom metrics are standard resolution (one minute) or high resolution (one second). Custom metrics and high-resolution data are billed, so publish what you will actually use.

Statistics and percentiles

When you read a metric you choose a statistic over a period: Average, Sum, Minimum, Maximum, SampleCount, or a percentile such as p95 or p99.

This is where many teams go wrong. An average latency of 120 ms can hide the fact that one request in a hundred takes over two seconds. The p99 shows those slow requests, and those are the users who complain or leave. Watch percentiles for latency, and sums for errors.

How long data is kept

CloudWatch keeps metric data for 15 months, rolling it up as it ages:

  • Sub-minute (high-resolution) data points: 3 hours
  • One-minute data points: 15 days
  • Five-minute data points: 63 days
  • One-hour data points: 455 days (15 months)

So last week's spike is visible minute by minute, but last year's only hour by hour. If you need finer detail for longer, export or store it elsewhere.

Where AI fits

If you call models through Amazon Bedrock, CloudWatch already has the numbers that matter. Bedrock publishes runtime metrics in the AWS/Bedrock namespace with a ModelId dimension, including InputTokenCount, OutputTokenCount, InvocationLatency, TimeToFirstToken (for streaming calls), InvocationClientErrors, InvocationServerErrors and InvocationThrottles. Tokens drive your on-demand bill; latency and time to first token are what your users feel. One detail from the docs: a request that fails before Bedrock knows the model is published without the ModelId dimension, so filtering by model can undercount errors.

Quick recap

  • A metric is numbers over time, identified by namespace, name and dimensions.
  • AWS services send many metrics for free; custom metrics go down to one second.
  • Watch percentiles, not just averages. Data is kept 15 months, rolled up as it ages.
  • Bedrock publishes tokens, latency and errors per model.
AWS in 1 Min #153 · 1:14

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS