-
Notifications
You must be signed in to change notification settings - Fork 2.2k
enhancement(aws_cloudwatch_logs sink): stop calling DescribeLogStreams for sequence tokens #25788
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
Open
vvo
wants to merge
5
commits into
vectordotdev:master
Choose a base branch
from
vvo:fix/aws-cloudwatch-logs-drop-describe-log-streams
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+84
−84
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
66c1daa
enhancement(aws_cloudwatch_logs sink): stop calling DescribeLogStream…
vvo 2934e24
Merge branch 'master' into fix/aws-cloudwatch-logs-drop-describe-log-…
vvo ebb5392
enhancement(aws_cloudwatch_logs sink): drop dead sequence-token plumbing
vvo f48c5b1
Merge remote-tracking branch 'fork/fix/aws-cloudwatch-logs-drop-descr…
vvo f87966b
fix(aws_cloudwatch_logs sink): resolve missing group/stream via descr…
vvo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelog.d/aws_cloudwatch_logs_drop_describe_log_streams.enhancement.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| The `aws_cloudwatch_logs` sink no longer calls `DescribeLogStreams` before every batch to fetch a sequence token. Since January 2023 CloudWatch Logs accepts `PutLogEvents` without a sequence token and never returns `InvalidSequenceToken`, so the sink now writes directly and only falls back to `DescribeLogStreams` (to locate a missing group/stream) when `PutLogEvents` returns `ResourceNotFoundException`. This removes the per-batch (and per-retry) `DescribeLogStreams` request, which is throttled account-and-region-wide at a low default quota (25 TPS) and could stall the sink under load on large fleets writing to many streams. | ||
|
|
||
| authors: vvo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the group already exists but the stream is missing, the new
PutLogEventspath still entersState::CreateGroup; afterCreateLogGroupreturnsResourceAlreadyExists, this block now callsPutRetentionPolicyif retention is enabled. That means Vector can overwrite retention on an existing group even thoughRetention::enabledis documented as applying when creating a new log group (src/sinks/aws_cloudwatch_logs/config.rs:45), whereas the previous describe-first flow only reached this code after an actual group creation.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in f87966b. State::CreateGroup is now only entered from the DescribeLogStreams ResourceNotFoundException branch, i.e. when the group genuinely does not exist. When the group exists but the stream is missing, the describe returns success and we go to CreateStream, never CreateGroup. The ResourceAlreadyExists fall-through here only fires on a concurrent-create race, and applying retention in that case matches the pre-existing upstream behavior (the old describe-first flow also reached PutRetentionPolicy only after deciding to create the group). So retention is not applied to groups that already existed at describe time.