Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document retry configuration for rate throttling on log group creation #47

Open
sam-axiadids opened this issue Sep 6, 2017 · 5 comments

Comments

@sam-axiadids
Copy link

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

@kislyuk
Copy link
Owner

kislyuk commented Sep 6, 2017

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 boto/botocore#1260 for details of how to configure the boto3 retry logic.

@kislyuk kislyuk closed this as completed Sep 6, 2017
@sam-axiadids
Copy link
Author

Thanks ! will look into it.

@renlon
Copy link

renlon commented Jan 6, 2020

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?

@covatic-john
Copy link

@renlon did you work out how to do this?

@kislyuk
Copy link
Owner

kislyuk commented Oct 1, 2023

Reopening to track documenting this.

@kislyuk kislyuk reopened this Oct 1, 2023
@kislyuk kislyuk changed the title Retry / rate throttling on log group creation Document retry configuration for rate throttling on log group creation Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants