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

make fluentd-async-connect configurable #4476

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

singholt
Copy link
Contributor

@singholt singholt commented Jan 23, 2025

Summary

This PR makes the --fluentd-async-connect option of the fluentd log driver configurable via the agent config. This option specifies whether the log driver connects to the Firelens sidecar container asynchronously or not.

Since the launch of ECS Firelens, this option has been hard-coded to true (enabled) in the ECS agent. Recently, we've had a customer report log loss during task shutdown, especially when the app container emits logs at a high throughput. We've identified that disabling the async connection option increases reliability and prevents log loss.

This configurable setting gives customers an option to turn on/off the async option as per their use-case. Additionally, we will work with the upstream Docker community and AWS container runtime team to identify improvements within the log driver itself.

Implementation details

  1. Added a new env var ECS_ENABLE_FIRELENS_ASYNC which translates to the FirelensAsyncEnabled agent config option. This defaults to true, preserving the current agent behavior.
  2. Updated the docker engine to parse agent config while generating the log driver config.
  3. Updated the README with the new option.

Testing

New tests cover the changes: yes

Description for the changelog

Enhancement: make the fluentd-async-connect log driver option configurable.

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No

Does this PR include the addition of new environment variables in the README?

Yes, updated the README.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@singholt singholt force-pushed the firelens-async-config branch 6 times, most recently from 13df33a to 000ccbd Compare January 24, 2025 02:38
@singholt singholt changed the title [wip] make fluentd-async-connect configurable via agent config Jan 24, 2025
@singholt singholt changed the title make fluentd-async-connect configurable via agent config make fluentd-async-connect configurable Jan 24, 2025
@singholt singholt marked this pull request as ready for review January 24, 2025 17:54
@singholt singholt requested a review from a team as a code owner January 24, 2025 17:54
@singholt singholt force-pushed the firelens-async-config branch from 000ccbd to 4fe805f Compare January 24, 2025 23:32
@singholt singholt force-pushed the firelens-async-config branch from 5c1c646 to ea50d01 Compare February 3, 2025 17:41
@singholt singholt merged commit 0f64bd3 into aws:dev Feb 3, 2025
40 checks passed
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.

4 participants