watchtower icon indicating copy to clipboard operation
watchtower copied to clipboard

Document retry configuration for rate throttling on log group creation

Open sam-axiadids opened this issue 8 years ago • 5 comments

We are getting a lot of Rate limit exceeded when logging to new log groups that are created dynamically, Would be good to have a sleep/retry on "Rate limit exceeded" exceptions on log group creation - probably should be on:

def _idempotent_create(_callable, *args, **kwargs): try: _callable(*args, **kwargs) except ClientError as e: if e.response.get("Error", {}).get("Code") != "ResourceAlreadyExistsException": raise

sam-axiadids avatar Sep 06 '17 04:09 sam-axiadids

Boto3 already performs retries on these types of errors. The fact that you're running into these errors means that either you're overloading the API and need to redesign your app to avoid the overloading, or tune the Boto3 retry logic for your needs. You can tune the retry logic by passing a custom Boto3 CloudWatch Logs client to Watchtower. See https://github.com/boto/botocore/pull/1260 for details of how to configure the boto3 retry logic.

kislyuk avatar Sep 06 '17 15:09 kislyuk

Thanks ! will look into it.

sam-axiadids avatar Sep 07 '17 01:09 sam-axiadids

It seems that the Class -- "watchtower.CloudWatchLogHandler" only takes boto3_session object. You methioned that "You can tune the retry logic by passing a custom Boto3 CloudWatch Logs client to Watchtower". is there an example of how to pass Boto3 CloudWatch Logs client to Watchtower?

renlon avatar Jan 06 '20 03:01 renlon

@renlon did you work out how to do this?

covatic-john avatar Sep 27 '23 11:09 covatic-john

Reopening to track documenting this.

kislyuk avatar Oct 01 '23 15:10 kislyuk