# API Gateway Count alarm for one HTTP API route

CloudWatch alarms · Updated 17 November 2026

**Short answer:** To catch one HTTP API route going quiet, alarm on Count (SampleCount) with per-route detailed metrics enabled, below your threshold for 10 of 10 one-minute periods. AWS lists the dimensions as ApiId, Stage, Resource and Method; confirm the names your API actually publishes with list-metrics before creating it.

## When a per-route alarm earns its keep

The [stage-level HTTP API Count alarm](https://cloudconsole.dev/alarms/api-gateway-http-api-count) only notices when the whole API goes quiet. A per-route alarm catches a single broken flow: a webhook route a partner stopped calling, a `POST /signup` route that a front-end change no longer reaches. Use it for the few routes where silence means lost business, not for every route.

It needs **detailed metrics** on the stage, which publish a set of metrics per route and are billed as custom metrics.

## Recommended settings

| Setting | Value |
|---|---|
| Namespace | `AWS/ApiGateway` |
| Metric | `Count` |
| Dimensions | `ApiId`, `Stage`, `Resource`, `Method` |
| Statistic | `SampleCount` |
| Period | 60 seconds |
| Datapoints to alarm | 10 |
| Evaluation periods | 10 |
| Comparison operator | `LessThanThreshold` |
| Threshold | Depends on your situation: per-route baseline |

Settings from the CloudWatch [recommended alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html) page. **Check the dimensions:** AWS's table lists `Resource` and `Method`, the names REST APIs use. The HTTP API metrics documentation describes per-route data under a single `Route` dimension whose value is the route key, such as `POST /signup`. Whichever your account shows is what the alarm must use; an alarm on dimension names that are not published stays in `INSUFFICIENT_DATA`.

## Enable detailed metrics and confirm the dimensions

```
aws apigatewayv2 update-stage --api-id a1b2c3d4e5 --stage-name prod \
  --default-route-settings DetailedMetricsEnabled=true

aws cloudwatch list-metrics --namespace AWS/ApiGateway --metric-name Count \
  --dimensions Name=ApiId,Value=a1b2c3d4e5 Name=Stage,Value=prod \
  --query "Metrics[].Dimensions"
```

Send a few test requests after enabling it; metrics only appear once a route has traffic.

## Create it

```
# Published dimension set. If list-metrics shows a Route dimension instead,
# replace Resource and Method with:  Name=Route,Value="POST /signup"
aws cloudwatch put-metric-alarm \
  --alarm-name signup-route-low-traffic \
  --namespace AWS/ApiGateway \
  --metric-name Count \
  --dimensions Name=ApiId,Value=a1b2c3d4e5 Name=Stage,Value=prod Name=Resource,Value=/signup Name=Method,Value=POST \
  --statistic SampleCount \
  --period 60 \
  --evaluation-periods 10 \
  --datapoints-to-alarm 10 \
  --threshold 2 \
  --comparison-operator LessThanThreshold \
  --treat-missing-data breaching \
  --alarm-actions arn:aws:sns:eu-west-2:123456789012:ops-alerts \
  --region eu-west-2
```

Choose the threshold from the route's own history: find its quietest healthy minute over a fortnight and alarm below roughly half of it. Routes with genuinely idle minutes need either a longer period than one minute or a synthetic canary instead of this alarm.

## When it fires

- **Is the route still defined?** `aws apigatewayv2 get-routes --api-id a1b2c3d4e5`. A route key changed from `POST /signup` to `POST /v2/signup` in a deploy moves the traffic and empties this metric.
- **Are callers getting errors before routing?** Requests rejected by CORS preflight in a browser never reach the route.
- **Did the caller change?** For webhook routes, check the sender's delivery dashboard or retry logs.
- **Is it legitimately quieter?** If a feature was retired, delete the alarm rather than raising the threshold to zero.

## Questions

### What dimension identifies a route in HTTP API metrics?

AWS's recommended-alarm table lists Resource and Method, while the HTTP API metrics reference describes a Route dimension. Run list-metrics on your API and use whatever it returns.

### Why is my per-route Count alarm in INSUFFICIENT_DATA?

Usually detailed metrics are off, the route has had no traffic since they were enabled, or the dimension names or values do not exactly match what is published.

### Does detailed metrics cost extra?

Yes. Per-route metrics are charged as CloudWatch custom metrics, so enable them where you will use them.

## When this happens away from your desk

Per-route silence is subtle: the API looks healthy while one flow is dead. CloudConsole, a phone app for AWS, is built to show route-level alarms and their traffic on a phone so these partial failures stand out.

[About the CloudConsole app](https://cloudconsole.dev/aws-console-app) · [Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710)

## Sources

- [Recommended alarms for AWS services (Amazon CloudWatch User Guide)](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html)
- [Metrics for HTTP APIs in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-metrics.html)

## Related

- [CloudWatch alarm for API Gateway Count (HTTP API stage)](https://cloudconsole.dev/alarms/api-gateway-http-api-count)
- [API Gateway Count alarm by Resource and Method (REST API)](https://cloudconsole.dev/alarms/api-gateway-count-per-method)
- [API Gateway Latency alarm per HTTP API route](https://cloudconsole.dev/alarms/api-gateway-http-api-latency-per-route)
- [aws cloudwatch list-metrics](https://cloudconsole.dev/cli/cloudwatch-list-metrics)
- [aws cloudwatch describe-alarms](https://cloudconsole.dev/cli/cloudwatch-describe-alarms)
- [CloudWatch alarm for API Gateway 4xx (HTTP API)](https://cloudconsole.dev/alarms/api-gateway-4xx)

---

Source: https://cloudconsole.dev/alarms/api-gateway-http-api-count-per-route

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
