Get percentage of AWS Lambda invocations that have errors

Our AWS Lambda invocation counts vary quite a lot over time, as our users are primarily in a narrow band of timezones. So, setting up a single threshold for alerting based on error counts is not very meaningful, due to the spikes in invocations. How can I configure an alert based on the ratio of invocations to errors (e.g. alert on > 5% error rate)?