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

Keep "nextSequenceToken" from "put_log_events" API call #177

Closed
wants to merge 1 commit into from

Conversation

spatsatzis
Copy link

Keep "nextSequenceToken" from "put_log_events" API call in order to avoid calling "describe_log_streams_with_retries" for a "sequenceToken"

Issue #, if available:
Currently, each time that "flush()" method is called to log data to Amazon CloudWatch a new "describe_log_streams_with_retries()" API call is made to fetch the latest "sequenceToken".

With multiple "Instance Scheduler" solutions in the same AWS account the above behavior might cause throttles for the "DescribeLogStreams" action, the limit is 5 transactions per second (TPS/account/Region) [1]

Description of changes:
With this pull request the "nextSequenceToken" returned by "put_log_events()" method [2] will be stored and re-used in the next "put_log_events()" call in order to avoid calling "describe_log_streams_with_retries" again.

[1] https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html
[2] https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs.html#CloudWatchLogs.Client.put_log_events

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…void calling "describe_log_streams_with_retries" for a "sequenceToken"
@rakshb
Copy link

rakshb commented Jul 27, 2020

Thanks for your contribution @spatsatzis. We will review your PR and consider this for a future release

@maykays maykays closed this Oct 21, 2020
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

Successfully merging this pull request may close these issues.

3 participants