Quick post on how to set Alarms in AWS CloudWatch that trigger for certain URLs only. This assumes you use API Gateway.
Bascially, you can set Alarms in 3 ways only: Either on the entire API, on the API and the Stage OR on API, Stage, Resource and Method. For the latter two Enable Detailed CloudWatch Metrics has to be checked in the Logs section of Stage properties.
That’s basically it. You need all four dimensions if you want to filter by URL and you need enable Cloudwatch metrics on the stage.
Here’s a YAML snippet showing the declaration of an alarm.
(I didn’t check the YAML but it should be fine.)
P.S.: You can follow me on Twitter.