Rate exceeded when requesting logs

Most of the times (4 in 5) I run:

sls logs -f function

I get the error:

Rate exceeded

Why does this happens? Is there a way to not exceed the rate?

Interesting. I haven’t seen this before.

Are you on a shared account?

The rate limit on cloudwatch is 10 requests per second per region https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html

I recommend including a startTime. Currently you are trying to retrieve all logs from when you’re logs begin.
For the last 5 minutes of logs, try:

sls logs -s <stage> -f <function> --startTime 5m

Or if you trying to tail the logs and watch them live(I do this all the time):

sls logs -s <stage> -f <function> -t --startTime 5m

Various intervals are available. See the Serverless Logs Docs

Hope it helps.

1 Like

@DavidWells no, it’s just two developers using it so we couldn’t go over 10 requests per second.
Could it be because I’m using Dashbird to monitor all the lambdas?

Thanks @bfieber, I’m now adding startTime and it seems to work!

1 Like