This repository has been archived by the owner on May 27, 2024. It is now read-only.
Add the TCP sink. Add support for log group name and log stream name. Add the Units reference. #9
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.
Description
This adds a TCP and Async sink. These allow non-Lambda deployments (e.g. ECS Fargate) to communicate to a CloudWatch Log Agent running as a side-car.
The Async sink can wrap any sink to allow processing to happen in the background. This ensures that production code isn't affected by network communicate to the agent.
There's also a new Units file that references all of the known units for CloudWatch.
Changes
The TCP sink will attempt to connect to the TCP endpoint up to 3 times before giving up. Errors will be sent back over a logger if it was supplied.
The Async sink will start a new thread when it's created, wrapping an existing sink.
#accept
pushes messages to a queue, which is#pop
'd by the thread and sent to the sink's#accept
.Messages that exceed the maximum queue size are dropped.
Updated Dependencies
Ticket
N/A
Screenshots
N/A
Notes
Recommended reading: Code Review guide
Optional Tasks
Library-Specific
Performance
It's working in a beta environment serving real traffic and performance seems stable :)